Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


April 17, 2007

Windows PowerShell Transforms Exchange Server 2007 Management

Create the management framework your company needs
RSS
Subscribe to Windows IT Pro | See More Scripting Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

I used to be a GUI wimp, but now I’m a Windows PowerShell whiz: Such is the transformation many Exchange Server administrators will need to go through to thrive in the administrative landscape that Microsoft has created in Exchange Server 2007. Exchange 2007's Exchange Management Shell uses PowerShell commands to perform and automate common activities, such as moving mailboxes between servers. In fact, you can perform some actions, such as setting diagnostics logging, managing public folders, and changing parameters for the transport service, only through shell commands. (Microsoft says it will reintroduce GUI management for public folders in Exchange 2007 Service Pack 1—SP1.)

Let's begin looking at the PowerShell basics you need to run your Exchange environment. Future articles will delve into the details of how to extract the maximum benefit from PowerShell when managing Exchange 2007.

A New Management Philosophy
In previous versions of Exchange, administrators' management options were limited to whatever Microsoft provided—specifically, the Administrator program for Exchange Server 5.5 and earlier or Exchange System Manager (ESM) for Exchange 2000 Server and later. Administrators could always use registry hacks to change the way that Exchange components behaved, but in most cases you could manage Exchange only through the options presented in the GUI. If you wanted to create scripts to automate administrative tasks, you ran into a confusing mishmash of APIs, such as Collaboration Data Objects for Exchange Management (CDOEXM), Windows Management Instrumentation (WMI), and Exchange Routing Objects, none of which worked with more than one or two versions of Exchange.

Exchange 2007 delivers a completely different experience for administrators. You still have a management program that, like ESM, is built on the Microsoft Management Console (MMC) framework, but the new Exchange Management Console is organized to present options more efficiently, as Figure 1 shows. Microsoft’s goals for the new management console were to reduce the number of clicks required to get to useful information, such as the properties of a mailbox, and to group all management operations in one place instead of putting some in the MMC Active Directory Users and Computers snap-in and others in ESM. Exchange Management Console also bundles a set of utilities into a toolbox, where you’ll find options such as a revamped Message Tracking tool and an updated version of the Exchange Server Best Practices Analyzer. The new console takes a little getting used to, but overall it succeeds in delivering a more cohesive and effective management program for Exchange.

Exchange 2007 represents a radical cultural change in management philosophy. The GUI provides easy access to common management operations and you’ll use it a lot, but Exchange 2007 embraces PowerShell in a way that's awesome in its depth, coverage, and capabilities. You can now create the management framework that your organization needs instead of waiting for a Microsoft developer to do it for you. If you need to perform a task that Exchange Management Console doesn’t offer, you can be pretty sure that you can create the option yourself with a PowerShell command.

Into the Shell
PowerShell provides an excellent command set (with individual commands known as cmdlets) to manage standard Windows components. (For more information about cmdlets, see the Windows IT Pro article "Introducing Windows PowerShell," August 2006, InstantDoc ID 50565, and "Exchange 2007: Life Without ExMerge?" January 9, 2007, InstantDoc ID 94629.) For example, the following command lists the 10 processes that are consuming the most CPU resources on a server:

Get-Process | sort CPU –descending | select –first 10

Figure 2 shows sample output from this command.

The Exchange 2007 setup program installs Exchange Management Console and Exchange Management Shell, a snap-in for PowerShell. Installing Exchange 2007 adds over 360 Exchange-related commands to the standard PowerShell cmdlets through the Exchange Management Shell snap-in. Although you'll typically invoke the Exchange Management Shell from the Start menu, you can also load it by using the command

Add-PSsnapin Microsoft.Exchange.Management.Msh.Admin

To list the set of services that make up Exchange 2007, you can type

Get-Service *Exch* | Select DisplayName, Status

Figure 3 shows an edited version of the output from this command.

As you can see, PowerShell uses a consistent syntax that consists of a verb (e.g., Get, Set, Move, Disable) followed by a noun (e.g., Mailbox, User). Along with commands that operate on objects, you'll find commands that help you work with data, such as Where, Sort, Group, Import-CSV, and Export-CSV. You can type Help followed by a command name at any time to show the syntax of the command. To list all the commands available to work with a specific server role or type of component, type Get-Help followed by the role or component name:

Get-Help –Role *Mailbox*
Get-Help –Component *Recipient*

Showing its comprehensive nature, PowerShell includes the ability to invoke programs. For example, you can invoke Word, open a Word document named Exchange.doc, and count the number of words in the document with the commands

Invoke-Item c:\Temp\Exchange.doc
Type c:\temp\Exchange.doc | Measure-Object –Line –Word

Table 1 lists a few especially useful Exchange 2007 cmdlets.

The Exchange developers have done a nice job of providing extensive, accessible help for the Exchange Management Shell commands. Table 2 lists switches you can use with the Get-Help command when you need more information than the default command provides. You’ll probably start by using the –Full switch to get to know what a command does, then move on to the default view after you become accustomed to working with Exchange Management Shell. Remember that the Exchange 2007 Help file contains information about all the Exchange Management Shell commands.

Embrace the Shell
Exchange 2007 embraces PowerShell as a management tool—and so should you. In future articles, I'll help you become familiar with PowerShell and Exchange Management Shell and uncover the ways that these tools can make your job easier.

End of Article



Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Friday at PASS Europe 2006

Kevin talks about the closing day of the event and shares a funny Microsoft film. ...

Escape From Yesterworld

Kevin points you to the funniest SQL Server website ever! ...

The Desktop tab is missing from the Display Properties in Windows XP?

...


Related Articles Tracking Messages in Exchange 2007

Managing Mailboxes with Exchange Management Shell

Using Exchange and Outlook's New Message-Classification Feature

PowerShell Buzz from Full Armor's Workflow Studio

Exchange Server and Outlook Whitepapers Anonymizers – The Latest Threat to Your Web Security

Replay for Exchange: Enterprise Protection and an Affordable Price

ETX Driving Embedded I/O

Related Events Check out our list of Free Email Newsletters!

Scripting eBooks Keeping Your Business Safe from Attack: Encryption and Certificate Services

Best Practices for Managing Linux and UNIX Servers

Building an Effective Reporting System

Related Scripting Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.

Job Openings in IT


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

WinConnections Conference Fall 2008
Don’t miss the premier event for Microsoft IT Professionals in Las Vegas, November 10-13. Register and book your room by August 25 and receive a FREE room night (based on a three night minimum stay).

Maximize your SharePoint Investment – 8 Cities
Discover best practices and tips for both architecting and administering SharePoint. Early Bird Price of $99 through Sept 15th.

Find a new job now on the all new IT Job Hound!
Search jobs, post your resume, and set up job e-mail alerts!

Master SharePoint with 3 eLearning Seminars
Learn how to build a better SharePoint infrastructure and enable powerful collaboration with MVPs Dan Holme and Michael Noel. Register today!

Top Tools for Virtualization Disaster Recovery & Replication
View this web seminar on August 14th to learn about two tools that will result in faster backup and restore with P2V disaster recovery.

SharePointConnections Conference Fall 2008
Don’t miss the premier event for Microsoft IT Professionals in Las Vegas, November 10-13. Register and book your room by August 25 and receive a FREE room night (based on a three night minimum stay).

VMworld 2008 - Sign Up Today!
Join your peers on September 15-18 at The Venetian Hotel in Las Vegas as VMware hosts VMworld 2008, the leading Virtualization event.



When managing just VMware isn’t enough
Plan/Manage/Secure – NetIQ VMware management. Download whitepaper.

What’s up with your network? Find out with ipMonitor
Availability monitoring for servers, applications and networks – FREE trial

Microsoft® Tech•Ed EMEA 2008 IT Professionals
Advance your thinking with new ideas and practical real-world solutions at Microsoft’s FIVE day technical infrastructure conference 3-7 Nov., 2008. Register before 26 September 2008 to save €300.

Order Your Fundamentals CD Today!
Gain an introduction to Exchange, learn server security requirements, and understand how unified communications can play a role in your messaging strategies with this free Exchange CD.

Are You Really Compliant with Software Regulations?
View this web seminar that will help you with compliance best practices and check out a management solution to assure that you won’t be in jeopardy of an audit.

Virtualization Congress Oct. 14-16 in London
Don't miss Virtualization Congress, the premiere EMEA conference dedicated to hardware, OS and application virtualization. Oct. 14-16 in London.
Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technical Resources Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing