In this chapter:
-
Microsoft Management Console
-
Using the Exchange Management Console
-
Using the Exchange Management Shell
-
Summary
Now that you’ve installed Microsoft Exchange Server 2007, you’re probably eager to start working with it. You’ll want to begin creating mailboxes, groups, and other recipients, but first you need to know some basics of managing the Exchange system.
Exchange Server 2007 introduces a radical shift in the way you manage an Exchange server or organization. Exchange Server 2007 is built entirely upon a new command-line interface named Exchange Management Shell—a modified version of the new Windows PowerShell. You can perform just about every imaginable administrative function with Exchange Server 2007 by using shell commands called cmdlets.
The graphical management interface for Exchange Server 2007 is Exchange Management Console. It is essentially a Microsoft Management Console (MMC) snap-in that is built to run commands from the Exchange Management Shell. Whenever you configure an object in the console or run a wizard, the interface actually is using the underlying Exchange Management Shell to issue the appropriate commands. In fact, when you issue a command in the console, it even provides information about how to issue those same commands from the Exchange Management Shell, providing a friendly way to get to know the shell interface and command structure.
This chapter introduces you to the Microsoft Management Console, the Exchange Management Console, and the Exchange Management Shell. Throughout this book, you learn about ways to perform administrative functions in both interfaces. This chapter is meant to give you grounding in the two interfaces you’ll be using to manage Exchange Server 2007.
Microsoft Management Console
Microsoft Management Console (MMC) provides a common environment for the management of various system and network resources. MMC is actually a framework that hosts modules called snap-ins, which provide the actual tools for managing a resource. For example, you manage Exchange Server 2007 using the Microsoft Exchange snap-in.
MMC itself does not provide any management functionality. Rather, the MMC environment provides for seamless integration between snap-ins. This allows administrators and other users to create custom management tools from snap-ins created by various vendors. Administrators can save the tools they have created for later use and share them with other administrators and users. This model gives administrators the ability to delegate administrative tasks by creating different tools of varying levels of complexity and giving them to the users who will perform the tasks.
The Action menu provides access to commands pertinent to the object you have selected in the console. The commands on the Action menu change depending on what snap-in is loaded and what object within that snap-in is currently selected.
The File menu is where most of the action is. From this menu, you can open and save consoles and even create new ones. You can also add snap-ins to and remove them from open consoles and set general MMC options. Options you can set include the following:
In addition to the standard views, for some snap-ins you can also create a taskpad view to show in the Details pane. A taskpad view is a dynamic HTML (DHTML) page that presents shortcuts to commands available for a selected item in the Scope pane. Each command is represented as a task that consists of an image, a label, a description, and a mechanism for instructing the snap-in to run that command. Users can run the commands by clicking a task.
You can use taskpad views to do the following things:
Snap-ins extend MMC by adding and enabling management behavior. They can provide this behavior in a number of ways. For example, a snap-in might add elements to the container tree, or it might extend a particular tool by adding shortcut menu items, toolbars, property sheet tabs, wizards, or Help to an existing snap-in. There are two basic types of snap-ins:
For example, you could create a custom console, as shown in Figure 10-3, that includes the Microsoft Exchange, Active Directory Users and Computers, Disk Management, and Event Viewer snap-ins—several tools that are important to any Exchange administrator.
MMC itself does not provide any management functionality. Rather, the MMC environment provides for seamless integration between snap-ins. This allows administrators and other users to create custom management tools from snap-ins created by various vendors. Administrators can save the tools they have created for later use and share them with other administrators and users. This model gives administrators the ability to delegate administrative tasks by creating different tools of varying levels of complexity and giving them to the users who will perform the tasks.
The MMC User Interface
When you first load MMC, you might notice that it looks a lot like Microsoft Windows Explorer. MMC uses a multiple-document interface, meaning that you can load and display multiple console windows in the MMC parent window simultaneously. Figure 10-1 shows the MMC parent window with the Microsoft Exchange snap-in loaded. The next few sections discuss the main parts of this window.MMC Toolbar
The main MMC toolbar holds six menus: File, Action, View, Favorites, Window, and Help. The View, Favorites, Window, and Help menus are pretty much what you would expect. The View menu lets you customize the columns you see in the display and turn on or off visual effects. The Favorites menu lets you add items to a list of favorites and organize that list into categories. The Favorites list can include shortcuts to tools, items in the console, or tasks. The Window menu lets you manage console windows if you have more than one window open in MMC. The Help menu lets you access general MMC Help as well as Help for the snap-ins that are currently loaded.The Action menu provides access to commands pertinent to the object you have selected in the console. The commands on the Action menu change depending on what snap-in is loaded and what object within that snap-in is currently selected.
The File menu is where most of the action is. From this menu, you can open and save consoles and even create new ones. You can also add snap-ins to and remove them from open consoles and set general MMC options. Options you can set include the following:
- Console Title Specifies the console name as it appears in the MMC title bar.
- Console Mode Author mode grants the user full access to all MMC functionality. User mode comes in three flavors: Full Access lets the user access all MMC commands but not add or remove snap-ins or change console properties; Limited Access Multiple Window allows the user to access only the areas of the console tree that were visible when the console was saved and to open new windows; Limited Access Single Window works the same as Limited Access Multiple Window, except that users cannot open new windows.
Scope Pane
The Scope pane contains a hierarchy of containers referred to as a console tree. Some containers are displayed as unique icons that graphically represent the type of items they contain. Others are displayed as folders, simply indicating that they hold other objects. Click the plus sign next to a container to expand it and display the objects inside. Click the minus sign to collapse the container.Details Pane
The Details pane changes to show the contents of the container selected in the Scope pane. In other words, the Details pane shows the results of the currently selected scope. The Details pane can display information in a number of ways, referred to as views.In addition to the standard views, for some snap-ins you can also create a taskpad view to show in the Details pane. A taskpad view is a dynamic HTML (DHTML) page that presents shortcuts to commands available for a selected item in the Scope pane. Each command is represented as a task that consists of an image, a label, a description, and a mechanism for instructing the snap-in to run that command. Users can run the commands by clicking a task.
You can use taskpad views to do the following things:
- Include shortcuts to all the tasks a specific user might need to perform.
- Group tasks by function or user by creating multiple taskpad views in a console.
- Create simplified lists of tasks. For example, you can add tasks to a taskpad view and then hide the console tree.
- Simplify complex tasks. For example, if a user frequently performs a given task involving several snap-ins and other tools, you can organize, in a single location, shortcuts to those tasks that run the appropriate property sheets, command lines, dialog boxes, or scripts.
Snap-in Root Container
The snap-in root container is the uppermost container in the snap-in; it is usually named based on the product or task with which it is associated. MMC supports stand-alone and extension snap-ins. A stand-alone snap-in, such as Microsoft Exchange, provides management functionality without requiring support from another snap-in. Only one snap-in root container exists for each stand-alone snap-in. An extension snap-in requires a parent snap-in above it in the console tree. Extension snap-ins extend the functionality provided by other snap-ins.Containers and Objects
Exchange Server 2007 is a great example of an object-based, hierarchical directory environment. All the little bits and pieces that make up Exchange are objects that interact with one another to some degree. The objects you see in the scope and details panes can be divided into two types:- Containers Containers can contain both other containers and noncontainer objects. Container objects can also appear in the Details pane. They are used to logically group all the objects that make up a management environment. An administrator uses the container objects to organize the tree and then to navigate through it.
- Leaf Objects A leaf object is simply an object that cannot contain other objects. Some common leaf objects with which an administrator works daily include servers and connectors.
How MMC Works
The MMC interface permits snap-ins to integrate within a common management console. This gives all snap-ins a similar look and feel, although they might perform their tasks in different ways. The console itself offers no management functions; it merely acts as a host to the snap-ins. Snap-ins always reside in a console; they do not run by themselves.Snap-ins
Each MMC tool is built of a collection of instances of smaller tools called MMC snap-ins. A snap-in is the smallest unit of console extension and represents one unit of management behavior. The snap-in might call on other supporting controls and dynamic-link libraries (DLLs) to accomplish its task.Snap-ins extend MMC by adding and enabling management behavior. They can provide this behavior in a number of ways. For example, a snap-in might add elements to the container tree, or it might extend a particular tool by adding shortcut menu items, toolbars, property sheet tabs, wizards, or Help to an existing snap-in. There are two basic types of snap-ins:
- Stand-alone Snap-ins Provide management functionality even if they are alone in a console with no other supporting snap-ins. They do not rely on any other snap-ins being present. The Exchange System snap-in is an example of a stand-alone snap-in.
- Extension Snap-ins Provide a variety of functionality, but only when used in conjunction with a parent snap-in. Some extend the console namespace, while others simply extend context menus or specific wizards.
Packages
Snap-ins are usually shipped in groups called packages. For example, the Microsoft Windows operating system itself includes one or more packages of snap-ins. Additionally, other vendors might ship products composed entirely of packages of snap-ins. Grouping snap-ins into packages provides convenience for downloading and installation. It also permits several snap-ins to share core DLLs so that these DLLs do not have to be placed in every snap-in.Custom Tools
MMC provides functionality for creating custom management tools. It allows administrators to create, save, and then delegate a customized console of multiple snap-ins tailored for specific tasks. Administrators can assemble these specific snap-ins into a tool (also called a document) that runs in one instance of MMC. For example, you can create a tool that manages many different aspects of the network—Active Directory, replication topology, file sharing, and so on. After assembling a tool, the administrator can save it in an .msc file and then reload the file later to instantly re-create the tool. The.msc file can also be e-mailed to another administrator, who can then load the file and use the tool.Custom Consoles
One of the primary benefits of MMC is its support for customization of tools. You can build custom MMC consoles tailored for specific management tasks and then delegate those consoles to other administrators. These tools can focus on the particular management requirements of various administrator groups.For example, you could create a custom console, as shown in Figure 10-3, that includes the Microsoft Exchange, Active Directory Users and Computers, Disk Management, and Event Viewer snap-ins—several tools that are important to any Exchange administrator.
Using the Exchange Management Console
The Exchange Management Console provides a graphical view of all the resources and components of an Exchange organization. No matter how many servers you have set up, you can manage them all from a single Exchange Management Console window. Use this window, and the property sheets of all the objects in it, to navigate the Exchange organizational hierarchy and perform the various tasks associated with Exchange administration.
You use both container and leaf objects to administer an Exchange organization. Most objects in the Exchange System console window—both container and leaf—have a property sheet that allows you to configure various parameters for that object and make it act in the way that best serves the organization’s needs. You can open an object’s property sheet by selecting the object and choosing Properties from the Action menu. You can also right-click an object and choose Properties from its shortcut menu. You use property sheets to both configure and administer Exchange Server 2007.
Learning the contents and layout of the various property sheets in the Exchange Management Console is a key to learning how Exchange Server 2007 works. After you know how to organize tasks that match the way Exchange Server 2007 is structured, your administrative tasks flow more easily.
To administer an Exchange environment with the Exchange Management Console, you must log on to Active Directory under a domain user account that has administrative privileges for administering the Exchange organization.
There are four primary containers directly within the snap-in root container. The following sections describe each of these containers.
Exchange administrator roles are similar in function to Windows Server security groups. Administrator roles allow you to easily assign sets of permissions to users for the most common administrative functions in Exchange Server. Exchange administrative roles include the following:
The containers that appear under Server Configuration show only the Exchange servers that have a particular server role installed. The Server Configuration container contains the following containers:
The Recipient Configuration container contains the following containers:
The tools in the toolbox are divided into the following categories:
You use both container and leaf objects to administer an Exchange organization. Most objects in the Exchange System console window—both container and leaf—have a property sheet that allows you to configure various parameters for that object and make it act in the way that best serves the organization’s needs. You can open an object’s property sheet by selecting the object and choosing Properties from the Action menu. You can also right-click an object and choose Properties from its shortcut menu. You use property sheets to both configure and administer Exchange Server 2007.
Major Areas of the Exchange Management Console
You can start the Exchange Management Console by clicking Start, pointing to All Programs, then to Microsoft Exchange Server 2007, and then clicking Exchange Management Console. The Exchange Management Console is divided into the major areas shown in Figure 10-4. These areas include:- Console tree The console tree is located on the left side of the console and is organized by containers that represent the hierarchy of the Exchange organization. The specific containers that are displayed are based on the server roles that are installed. When you select a container in the console tree, the results of that container are shown in the Result pane.
- Results pane The Results pane is located in the center of the console. This pane displays objects that reflect the container you have selected in the console tree. For example, if you select the Mailbox object inside the Recipient Configuration container, the Results pane shows individual mailboxes.
- Work pane The Work pane is located at the bottom of the Result pane. The Work pane is shown only when you select objects under the Server Configuration container, such as Mailbox, Client Access, or Unified Messaging. This pane displays objects based on the server role that is selected in the Server Configuration container. For example, if you select the Mailbox object in the Server Configuration container, the Results pane shows a list of Mailbox servers. When you select a server in the Results pane, storage groups on that server are shown in the Work pane.
- Actions pane The Actions pane is located on the right side of the console. This pane lists actions you can perform based on the object that is selected in the console tree, Results pane, or Work pane. These actions are the same actions you can take by displaying the Action menu or by right-clicking the object. For this reason, you might find it more useful to hide the Actions pane. You can do this by clicking the Show/Hide Action Pane button on the Exchange Management Console toolbar.
Real World Explore!
The sheer number of property sheets you encounter when administering Exchange Server 2007 can seem daunting, but don’t let them intimidate you. Take the time to play with the program. You probably won’t be able to remember exactly where to go to accomplish every administrative task in Exchange Server 2007, but it helps to think about what the task involves. If you need to manage the way all mailboxes on a server are handled, find the Mailbox container inside the Server Configuration container. If you need to manage a single mailbox, find the Mailbox container inside the Recipient Configuration container. Each component handles a different aspect of the configuration, so multiple components might be involved with a single configuration or administrative task. As you use the program and get used to the Exchange environment, it becomes easier to navigate the program and find exactly the object or objects you need to administer.Learning the contents and layout of the various property sheets in the Exchange Management Console is a key to learning how Exchange Server 2007 works. After you know how to organize tasks that match the way Exchange Server 2007 is structured, your administrative tasks flow more easily.
To administer an Exchange environment with the Exchange Management Console, you must log on to Active Directory under a domain user account that has administrative privileges for administering the Exchange organization.
Examining the Exchange Hierarchy
The top of the hierarchy in the console tree of the Exchange Management Console is the snap-in root container that represents the Exchange organization, as shown in Figure 10-5. The snap-in root container is named Microsoft Exchange. All the Exchange containers are held within this container. Additionally, selecting the root container shows two tabbed screens in the Results pane: Finalize Deployment, which shows you tasks to perform after installation (and which is discussed in Chapter 6, “Installing Exchange Server 2007”); and End-to-End Scenario, which allows you to configure end-to-end solutions in Exchange, such as implementing best practices for disaster recovery.There are four primary containers directly within the snap-in root container. The following sections describe each of these containers.
Organization Configuration
Selecting the Organization Configuration container itself displays all users configured as Exchange administrators and allows you to configure administrative access roles for users or groups, as shown in Figure 10-6. You must be a member of the Exchange Server Administrators group in order to view the Organization Configuration container or change the roles assigned to users.Exchange administrator roles are similar in function to Windows Server security groups. Administrator roles allow you to easily assign sets of permissions to users for the most common administrative functions in Exchange Server. Exchange administrative roles include the following:
- Exchange Server Administrators This role provides access to only local server Exchange configuration data, either in the Active Directory or on the physical computer on which Exchange Server 2007 is installed. Users who are members of the Exchange Server Administrators role have permissions to administer a particular server, but do not have permissions to perform operations that have global impact in the Exchange organization. Members assigned to this role are granted the following:
- They are made owners of all local server configuration data. As owners, members of the role have full control over the local server configuration data.
- They are made local administrators on the computer on which Exchange is installed.
- They are made members of the Exchange View-Only Administrators role.
- Exchange Organization Administrators Role The Exchange Organization Administrators role provides administrators with full access to all Exchange properties and objects in the Exchange organization. Additionally, members assigned this role are granted the following:
- They are made owners of the Exchange organization in the configuration container of Active Directory. As owners, members of the role have control over the Exchange organization data in the configuration container in Active Directory and the local Exchange server Administrator group.
- They are given Read access to all domain user containers in Active Directory. Exchange grants this permission during setup of the first Exchange Server 2007 server in the domain, for each domain in the organization. These permissions are also granted by being a member of the Exchange Recipient Administrator role.
- They are given Write access to all Exchange-specific attributes in all domain user containers in Active Directory. Exchange Server 2007 grants this permission during setup of the first Exchange Server 2007 server in the domain, for each domain in the organization. These permissions are also granted by being a member of the Exchange Recipient Administrator role.
- They are made owners of all local server configuration data. As owners, members have full control over the local Exchange server. Exchange Server 2007 grants this permission during setup of each Exchange server.
- Exchange Recipient Administrators Role The Exchange Recipient Administrators role has permissions to modify any Exchange property on an Active Directory user, contact, group, dynamic distribution list, or public folder object. Members are granted the following:
- They are given Read access to all the Domain User containers in Active Directory that have had Setup /PrepareDomain run in those domains.
- They are given Write access to all the Exchange-specific attributes on the Domain User containers in Active Directory that have had Setup /PrepareDomain run in those domains.
- They are automatically granted membership in the Exchange View-Only Administrator role.
- Exchange View-Only Administrators Role The Exchange View-Only Administrators role has read-only access to the entire Exchange organization tree in the Active Directory configuration container and read-only access to all the Windows domain containers that have Exchange recipients.
- Mailbox At the organization level, the Mailbox container allows you to manage Mailbox server role settings that apply to the entire Exchange organization. You can create and manage address lists, managed custom folders, messaging records management (MRM) mailbox policies, and offline address books (OABs). You learn more about this in Chapter 11, “Creating and Managing Recipients.”
- Client Access At the organization level, the Client Access container allows you to create and manage Exchange ActiveSync mailbox policies for mobile users. These policies apply common sets of security settings or policies to collections of users.
- Hub Transport At the organization level, the Hub Transport container allows you to configure features of the Hub Transport server role. The Hub Transport server role handles all internal mail flow, applies organizational message routing policies, and is responsible for delivering messages to a recipient’s mailbox.
- Unified Messaging At the organization level, the Unified Messaging container allows you to manage Unified Messaging (UM) server role settings that apply to your entire Exchange Server 2007 organization. You can maintain existing or create new UM dial plans, UM IP gateways, UM mailbox policies, and UM auto attendants. For more information on Unified Messaging, see Chapter 14, “Unified Messaging.”
Server Configuration
Use the Server Configuration container, shown in Figure 10-7, to view a list of all the servers in your Exchange organization and perform tasks specific to server roles. When you select the Server Configuration container itself, you can view the role, version, edition, product ID, cluster status, last modified time, and site for each server in the Results pane. For more information about how to view these columns in the Results pane, see the section, “Custom Consoles,” earlier in this chapter.The containers that appear under Server Configuration show only the Exchange servers that have a particular server role installed. The Server Configuration container contains the following containers:
- Mailbox At the server level, the Mailbox container allows you to display a list of all servers in the organization that have the Mailbox server role installed and to perform actions specific to that server role. The Database Management tab in the Work pane lists all the storage groups and databases that exist on the selected server.
- Client Access At the server level, the Client Access container allows you to view and maintain the settings for Microsoft Outlook Web Access (OWA), Exchange ActiveSync, and the offline address book (OAB).
- Hub Transport At the server level, the Hub Transport container allows you to display a list of all servers in the organization that have the Hub Transport server role installed and to perform actions specific to that server role.
- Unified Messaging At the server level, the Unified Messaging container allows you to configure voice messaging, fax, and e-mail messaging into one store that users can access from a telephone and a computer. Exchange Server 2007 Unified Messaging integrates Microsoft Exchange with telephony networks and brings the Unified Messaging features to the core of Microsoft Exchange.
Recipient Configuration
The Recipient Configuration container, shown in Figure 10-8, allows you to perform a variety of recipient management tasks. You can view all the recipients in your organization, create new recipients, and manage existing mailboxes, mail contacts, mail users, and distribution groups.The Recipient Configuration container contains the following containers:
- Mailbox At the recipient level, the Mailbox container allows you to manage mailbox users and resource mailboxes. Resource mailboxes include room and equipment mailboxes. You can create new mailboxes and remove, disable, or move existing mailboxes. You can also configure mailbox properties, enable and disable Unified Messaging (UM), and manage mobile devices.
- Distribution Group The Distribution Group container allows you to manage mail-enabled distribution groups (which include security groups) and dynamic distribution groups. You can create new distribution groups and remove, disable, or configure existing distribution groups.
- Mail Contact The Mail Contact container allows you to manage mail contacts. You can create new mail contacts and delete or configure existing mail contacts.
- Disconnected Mailbox The Disconnected Mailbox container allows you to view and connect disabled mailboxes. Disconnected mailboxes are retained based on the configured mailbox database limits. You will see only the mailboxes that have been disconnected within the retention period that is specified for the mailbox database.
Toolbox
The Toolbox is a collection of tools that are installed with Microsoft Exchange Server 2007. The Toolbox provides a central location for diagnostic, troubleshooting, and recovery activities using various Exchange tools.The tools in the toolbox are divided into the following categories:
- Configuration Management Tools This category contains only the Exchange Server Best Practices Analyzer, which automatically examines an Exchange Server 2007 deployment and determines whether the configuration is in line with Microsoft best practices. Run the Exchange Server Best Practices Analyzer after installing a new Exchange server or after making any configuration changes. You learn more about this tool in Chapter 15, “Troubleshooting Exchange Server 2007.”
- Disaster Recovery Tools This category contains two tools: Database Recovery Management Tool and Database Troubleshooter. Both tools work through a set of troubleshooting steps to help identify and resolve database issues.
- Mail Flow Tools This category contains the following three tools:
- Mail Flow Troubleshooter This tool allows you to troubleshoot common mail flow problems. After selecting a symptom of the mail flow problems you are experiencing (such as delays or non-delivery reports), the tool attempts to find a solution and then provides advice to walk you through the correct troubleshooting path. It shows an analysis of possible root causes and provides suggestions for corrective actions.
- Message Tracking Tool This tool lets you view a detailed log of all message activity as messages are transferred to and from an Exchange Server 2007 server that has the Hub Transport server role, the Mailbox server role, or the Edge Transport server role installed. You can use message tracking logs for mail flow analysis, reporting, and troubleshooting.
- Queue Viewer This tool allows you to monitor mail flow and inspect queues and messages. You can also perform actions to the queuing databases such as suspending or resuming a queue, or removing messages.
- Performance Tools This category contains two tools: Performance Monitor and Performance Troubleshooter. Performance Monitor is a tool you can configure to collect information about the performance of your messaging system. Specifically, you can use it to monitor, create graphs, and log performance metrics for core system functions. Performance Monitor is covered in detail in Chapter 17, “Tuning Exchange Server 2007 Performance.” Performance Troubleshooter helps you to locate and identify performance-related issues that could affect an Exchange server. You diagnose a problem by selecting the symptoms observed. Based on the symptoms, the tool walks you through the correct troubleshooting path. This tool is covered in Chapter 15.
Using the Exchange Management Shell
The Exchange Management Shell, shown in Figure 10-9, is based on Microsoft Windows PowerShell, which provides a powerful command-line interface for executing and automating administrative tasks. With the Exchange Management Shell, you can manage every aspect of Exchange Server 2007, including enabling new e-mail accounts, configuring store database properties, and just about every other management task associated with Exchange Server 2007.
In fact, you can use the Exchange Management Shell to perform every task available in the Exchange Management Console and a number of tasks that cannot be performed in the Exchange Management Console. It helps to think of it this way: the Exchange Management Console provides a graphical interface for most of the functionality of the Exchange Management Shell. When you run a command in the Exchange Management Console, the Exchange Management Shell is actually called to perform the command. When you perform a command in the Exchange Management Console, the graphic interface often even shows you the associated shell command, as shown in Figure 10-10.
So why use the shell instead of the console? Aside from the fact that some commands (such as those used to manage public folders) are only available as shell commands, the shell also offers a flexibility that can speed up and simplify common operations. For example, with a single shell command, you can get a list of recipients, filter that list according to a set of criteria, and then perform a function on only the filtered list of recipients.
To open the Exchange Management Shell, follow these steps:
In the Exchange Management Shell, a cmdlet is the smallest unit of functionality. A cmdlet is roughly analogous to a built-in command in other types of shells. You type cmdlets directly into the shell interface.
All cmdlets consist of at least two parts:
Get-MailboxServer
To use a parameter, type a space following the verb-noun pair and then type the parameters you need. The name of the parameter is always preceded by a hyphen (-) and the use of parameters follows this syntax:
Verb-Noun –ParameterName <ParameterValue> For example, to get information about a specific mailbox server (say, a server named contoso-exsrv1), add the identity parameter to the cmdlet, like this:
Get-MailboxServer –Identity contoso-exsrv1
When you use the Get-Help command by itself (that is, when you type no parameters with it), the shell provides basic information about using the shell, as shown in Figure 10-11.
You can also use several parameters along with the Get-Help cmdlet to get more focused help on the task you’re trying to perform. For example, you can use the name of a cmdlet as a parameter to get help on using that cmdlet. Typing the following gives you help on using the Get-MailboxServer cmdlet:
Get-Help Get-MailboxServer You can even go a step further by adding parameters to further narrow the help you receive. Following the Get-Help <cmdlet> syntax, you can add the following parameters:
For example, you can use Tab completion to quickly view the nouns associated with the get verb. Just type Get- at the prompt and then keep pressing Tab to cycle through the available nouns you can use with get.
For another example, if you cannot remember (or just didn’t want to type) a full cmdlet such as Get-MailboxServer, you can type Get-Mail and press Tab to find the correct cmdlet without having to type the full name.
In fact, you can use the Exchange Management Shell to perform every task available in the Exchange Management Console and a number of tasks that cannot be performed in the Exchange Management Console. It helps to think of it this way: the Exchange Management Console provides a graphical interface for most of the functionality of the Exchange Management Shell. When you run a command in the Exchange Management Console, the Exchange Management Shell is actually called to perform the command. When you perform a command in the Exchange Management Console, the graphic interface often even shows you the associated shell command, as shown in Figure 10-10.
So why use the shell instead of the console? Aside from the fact that some commands (such as those used to manage public folders) are only available as shell commands, the shell also offers a flexibility that can speed up and simplify common operations. For example, with a single shell command, you can get a list of recipients, filter that list according to a set of criteria, and then perform a function on only the filtered list of recipients.
To open the Exchange Management Shell, follow these steps:
- Click Start, point to All Programs, and then point to Microsoft Exchange Server 2007.
- Click Exchange Management Shell.
Understanding Cmdlets
At first glance, the shell may seem similar to other command-line interfaces with which you may be familiar. However, after working with the shell for just a few minutes, you see that there are dramatic differences.In the Exchange Management Shell, a cmdlet is the smallest unit of functionality. A cmdlet is roughly analogous to a built-in command in other types of shells. You type cmdlets directly into the shell interface.
All cmdlets consist of at least two parts:
- A verb The verb represents the action of the command. An example of a verb is get, which is used to retrieve information about an object. Table 10-1 lists the most common verbs used in the Exchange Management Shell.
- A noun The noun represents the recipient of the verb’s action. An example of a noun would be an object in the Exchange organization such as a mailbox server. The noun in this case would be MailboxServer.
Get-MailboxServer
Table 10-1 Common Verbs in the Exchange Management Shell
Obviously, you can’t do too much with just a verb and a noun. For example, the cmdlet Get-MailboxServer doesn’t provide enough information for the shell to do anything. You need to specify which mailbox server and likely what information you want to get. You provide this extra information through parameters. Parameters provide information to the cmdlet, either identifying an object and its attributes to act on, or controlling how the cmdlet performs its task. To use a parameter, type a space following the verb-noun pair and then type the parameters you need. The name of the parameter is always preceded by a hyphen (-) and the use of parameters follows this syntax:
Verb-Noun –ParameterName <ParameterValue> For example, to get information about a specific mailbox server (say, a server named contoso-exsrv1), add the identity parameter to the cmdlet, like this:
Get-MailboxServer –Identity contoso-exsrv1
Getting Help
Obviously, it is difficult to remember all the verbs, nouns, and parameters available in the Exchange Management Shell. Fortunately, there are several ways to get help right within the shell.Help Cmdlets
Three help cmdlets are available in the shell to help you find the information you need to perform tasks: Get-Help, Get-Command, and Get-ExCommand.When you use the Get-Help command by itself (that is, when you type no parameters with it), the shell provides basic information about using the shell, as shown in Figure 10-11.
You can also use several parameters along with the Get-Help cmdlet to get more focused help on the task you’re trying to perform. For example, you can use the name of a cmdlet as a parameter to get help on using that cmdlet. Typing the following gives you help on using the Get-MailboxServer cmdlet:
Get-Help Get-MailboxServer You can even go a step further by adding parameters to further narrow the help you receive. Following the Get-Help <cmdlet> syntax, you can add the following parameters:
- Get-Help <cmdlet> -Full Provides full help on the specified cmdlet.
- Get-Help <cmdlet> -Parameter <parametername> Provides just the help view for the specific parameter of the cmdlet you name.
- Get-Help <cmdlet> -Examples Provides just the examples portion of the help view for the cmdlet you name.
Tab Completion
Tab completion helps reduce typing when using the shell. When you have typed a partial cmdlet name, just press Tab, and the Exchange Management Shell completes the cmdlet name if it finds a matching cmdlet. If it finds multiple matching cmdlets, the shell cycles through each cmdlet name as you keep pressing Tab. When you use tab completion with cmdlet names, you must supply at least the verb and the hyphen (-).For example, you can use Tab completion to quickly view the nouns associated with the get verb. Just type Get- at the prompt and then keep pressing Tab to cycle through the available nouns you can use with get.
For another example, if you cannot remember (or just didn’t want to type) a full cmdlet such as Get-MailboxServer, you can type Get-Mail and press Tab to find the correct cmdlet without having to type the full name.
No comments:
Post a Comment