WMI PowerShell for Exchange 2003
As a quick follow-up for the Exchange 2000/2003 PowerShell post here are a few additional references.
TechNet Script Center has a good article on WMI classes available:
- Managing Exchange 2003 with WMI, Part 1
- Managing Exchange 2003 with WMI, Part 2
- Managing Exchange 2003 with WMI, Part 3
To use a class in PowerShell use Get-WMIObject. For example, to get queue information run:
Get-WmiObject -ComputerName YourExchangeServer -Class Exchange_Queue
Or if you are running the script locally on Exchange server just:
Get-WmiObject -Class Exchange_Queue
To add a node with Exchange 2003 queues to PowerGUI:
- In PowerGUI, right-click the folder where you want to add it, and click New / Node on the shortcut menu.
- Type in the name you want the node to have (e.g. Exchange Queues)
- Pick Get-WmiObject from the Command drop-down list.
- Type the actual class as the Class parameter (e.g. Exchange_Queue)
- If running remotely, specify the Exchange server name as the Computer Name:
As result you will get a UI like the one Nicolas created for his Exchange 2003 environment.
Here’s a list of WMI classes available (linked to their respective MSDN pages):
Note that they will not work for Exchange 2007. WMI is no longer supported there but the good news that PowerShell provides you much more.
Thanks to Dmitry Sotnikov for his article !
(Source = http://dmitrysotnikov.wordpress.com/2007/09/06/wmi-powershell-for-exchange-2003/ )