Managing Exchange Server 2007, Part II

In my last blog entry I described some of my initial impressions of Exchange Server 2007, in particular the impact of the 64-bit machine requirement. Now let me share a couple of thoughts about managing Exchange Server 2007 using Windows PowerShell. PowerShell is Microsoft’s new command shell and scripting language — essentially a major upgrade to the old cmd.exe shell and .bat file scripts. Exchange Server management is based on PowerShell. By that I mean you can perform all kinds of Exchange tasks from the command line. In fact there some Exchange 2007 tasks which must be done using command-line statements in Windows PowerShell. Although Exchange Server 2007 still has a GUI-based Exchange Management Console (EMC) for quick and easy tasks, you will spend a lot of time in the Exchange Management Shell (EMS) which is basically a customized PowerShell. For example, suppose you want to create a new network user with an e-mail account. With old versions of Exchange, you would create a user in Active Directory Users and Computers (ADUC) which would automatically invoke a GUI tool to create a mailbox for the user, and then if you wanted to configure Outlook Web Access you’d go to IIS. With Exchange Server 2007, to create a new network user with a mailbox you either a.) first create a new user with ADUC and then create the mailbox for the user with GUI-based EMC, or b.) create the user and mailbox simultaneously using the command-line based Exchange Management Shell. Here’s an example of using the PowerShell-based EMS:
C:\> new-mailbox -userPrincipalName user002@TEST.local
   -name user002
   -database "First Storage Group\Mailbox Database"
   -organizationalUnit Users
   -resetPasswordOnNextLogon $true
The shell will prompt you for an initial password and then create the user and mailbox which you can verify by using the GUI-based EMC or by entering the command "get-user". The EMS is Windows PowerShell, which includes 129 basic cmdlets (such as "set-location") plus an additional 381 cmdlets for Exchange (such as "new-mailbox"). Luckily, you only need to know how to use a handful of all these cmdlets. You can get a list of all 510 cmdlets by entering the command:
C:\> get-command | more
Or you can filter along the lines of:
C:\> get-command new-* | more
Once you zero-in on the cmdlet you want to use (for example, the new-mailbox cmdlet), you can get help like this:
C:\> get-help new-mailbox -detailed | more
So what’s the bottom line if you are currently an Exchange administrator, or recruit or hire Exchange administrators? Managing Exchange Server 2007 is quite a bit different from managing previous versions of Exchange and will require quite a bit of new command-line and scripting skills on your part, as well as a significant mind-set change.
This entry was posted in Software Test Automation. Bookmark the permalink.