Welcome to Sign in | Join | Help
in
Home Blog Forums

The Lazy Admin

Using PowerShell With Exchange 2003

Sponsor


PowerShell, also know as Microsoft Shell or Monad is a new shell combining a command line interface and scripting language. MSH is going to change the way Exchange administrators work when E12 is released, however, there is a lot MSH can do for Exchange 2003 administrators.

If you read the other MSH articles I have written you are already familiar with the capabilities of MSH and WMI. Using those same tools, you can gather and report on a multitude of Exchange 2003 WMI objects. Before we go any further lets recap MSH and WMI first. The get-wmiobject cmdlet can be used to query the computer and gather any and all WMI based information. Take a look at this short command to list the logical disk information of the computer. As an example lets look up the Logical_Disk WMI object.

MSH C:\> Get-wmiobject Win32_LogicalDisk

Now there are a number of WMI objects in Exchagne 2003 that you can lookup with this exact same method. The following examples are some that I use almost daily when managing my Exchange 2003 servers. Display the SMTP Message Queues g

et-wmiobject -class Exchange_SMTPQueue -Namespace ROOT\MicrosoftExchangev2 -ComputerName servername | select-object LinkName,MessageCount,Size

 

Display the sizes of all Mailboxes

get-wmiobject -class Exchange_Mailbox -Namespace ROOT\MicrosoftExchangev2 -ComputerName servername | select-object MailboxDisplayName,TotalItems,Size

Anything you can do with WMI in Exchange 2003, can be done with a much shorter command in PowerShell!

For more information see:

TheLazyadmin.com PowerShell Category





Published Thursday, March 23, 2006 5:54 AM by rodney.buike
Filed under:

Comments

No Comments
Anonymous comments are disabled


All postings are provided "AS IS" with no warranties, and confer no rights.
Microsoft product screen shot(s) reprinted with permission from Microsoft Corporation.