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