Exploring the Exchange 2007 Cmdlets


When trying to figure out what you can do with a Windows PowerShell enabled application, first examine the cmdlets that are installed with the application. We take several approaches to this task. The easiest way is to use the new alias Get-ExCommand. When you use the Get-ExCommand cmdlet, you will notice a listing of nearly 385 cmdlets that have been created by the Microsoft Exchange Server 2007 team. These cmdlets have been organized into the image from book Exchange2007Cmdlets.xls spreadsheet (in the Supplemental Material folder), and are grouped around 25 different verbs. These cmdlets allow you to update, uninstall, test, start, stop, suspend, set, add, remove, and perform other kinds of activities on your Exchange server. The only thing you cannot do using the Exchange Server 2007 cmdlets is to create the user or create the group. You can create a new user in Active Directory at the same time you create the mailbox by using the New-Mailbox cmdlet, but you cannot create a user account without creating the mailbox. For scripts that can create users and groups, refer to Chapter 7, “Working with Active Directory.”

Note 

The commands used in this chapter are in a text file named image from book Chapter9Commands.txt. This file includes all commands shown in this chapter. The ‘Exchange Management Shell Quick Reference’, which lists the common cmdlets, is available at the following URL: http://www.microsoft.com/downloads.

The good thing about the Get-ExCommand cmdlet is that you can pipeline it to other cmdlets to assist you in searching for exactly the correct cmdlet for a particular job. If, for example, you were looking for cmdlets related to statistics, you could use the following command to retrieve this information:

 Get-Excommand | Where-Object {$_.name -match "stat"} | Format-List name,definition

When this command runs, you are greeted with a list of seven cmdlets that provide information about statistics. A sample output from the previous command is shown here. You will notice, the good thing about using Format-List to format the command output is that the definition of the cmdlet is not truncated, as it is in the default output.

 Name       : Get-ActiveSyncDeviceStatistics Definition : Get-ActiveSyncDeviceStatistics [-Identity] <MobileDeviceIdParamete              r> [-ShowRecoveryPassword] [-Verbose] [-Debug] [-ErrorAction <Acti              onPreference>] [-ErrorVariable <String>] [-OutVariable <String>] [              -OutBuffer <Int32>]              Get-ActiveSyncDeviceStatistics -Mailbox <MailboxIdParameter> [-Sho              wRecoveryPassword] [-Verbose] [-Debug] [-ErrorAction <ActionPrefer              ence>] [-ErrorVariable <String>] [-OutVariable <String>] [-OutBuff              er <Int32>]




Microsoft Press - Microsoft Windows PowerShell Step by Step
MicrosoftВ® Windows PowerShell(TM) Step By Step (Step By Step (Microsoft))
ISBN: 0735623953
EAN: 2147483647
Year: 2007
Pages: 128
Authors: Ed Wilson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net