Archive for the 'WMI' Category

Video: Richard Siddaway – WMI: Gems and Gotchas

Another great recording from US TEC 2011 PowerShell Deep Dive – Richard’s session on WMI in PowerShell. Richard has written an entire book on that topic so he is probably one of the best experts in the area.

Abstract: “WMI has been part of the Windows environment for a long time, and has a reputation for being very powerful but very difficult. PowerShell has made WMI easier to use, but the interaction between the two is still relatively undocumented. PowerShell has also opened WMI up in a number of ways but introduces a number of “gotchas” in the process. This US Experts Conference 2011 PowerShell Deep Dive session demonstrates that that any “gotchas” can be overvcome and WMI offers a treasure trove of functionality to the administrator. The video also answers a number of key questions about WMI and PowerShell, including:

• Is Invoke-WmiMethod always the answer?
• How can I change WMI information?
• How does WMI authentication and authorisation work?
• Should I use explicit remoting, implicit remoting or WMI?
• WMI overlaps with some cmdlets e.g. Get-Process and Win32_Process — which should I use when?
• How do I get the best of WQL? Do I use queries or filters?

Slides: Slides-TEC-2011-Richard-Siddaway-WMI-Gems-and-Gotchas

Scripts: Scripts-TEC-2011-Richard-Siddaway-WMI-Gems-and-Gotchas


This is a live recording from US TEC 2011 PowerShell Deep Dive conference. TEC Europe is just around the corner – October 17-19th, 2011 in FrankfurtRegister today to get a discount.

See also:

PowerGUI 1.0.13 ships

PowerGUI has just got updated and there are a lot of great new features.

The PowerGUI main IT Pro UI has multiple improvements ranging from improved code generation and preserving window sizes, to the brand new WMI Browser pack right within the console!

The script editing got a lot of improvements: F1 help, ability to supply command-line parameters, background syntax check, intellisense for WMI classes, and much more.

Richard has already blogged about some of the features he liked the best.

So whether you are using PowerShell to manage your AD, Exchange or another platform, or you are a hardcore scripter – go get the latest version of PowerGUI. The price is still the same – $0.00. 😉

Tags: , ,

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:

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:

  1. In PowerGUI, right-click the folder where you want to add it, and click New / Node on the shortcut menu.
  2. Type in the name you want the node to have (e.g. Exchange Queues)
  3. Pick Get-WmiObject from the Command drop-down list.
  4. Type the actual class as the Class parameter (e.g. Exchange_Queue)
  5. If running remotely, specify the Exchange server name as the Computer Name:

Adding WMI Exchange 2003 Node to PowerGUI

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):

ExchangeClusterResource Class
ExchangeConnectorState Class
ExchangeLink Class
ExchangeQueue Class
ExchangeServerState Class
Exchange_DSAccessDC Class
Exchange_FolderTree Class
Exchange_Link Class
Exchange_Logon Class
Exchange_Mailbox Class
Exchange_MessageTrackingEntry Class
Exchange_PublicFolder Class
Exchange_Queue Class
Exchange_QueueCacheReloadEvent Class
Exchange_QueuedMessage Class
Exchange_QueuedSMTPMessage Class
Exchange_QueuedX400Message Class
Exchange_QueueSMTPVirtualServer Class
Exchange_QueueVirtualServer Class
Exchange_QueueX400VirtualServer Class
Exchange_ScheduleInterval Class
Exchange_Server Class
Exchange_SMTPLink Class
Exchange_SMTPQueue Class
Exchange_X400Link Class
Exchange_X400Queue Class

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.

Tags: , , ,

My Recent Tweets


The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

May 2021

%d bloggers like this: