My name is Rob Doucette and I am the Software Development Manager at BridgeWays (a division of Xandros). I am responsible for the development of all management packs at BridgeWays. Before joining Xandros, I held a Senior Software Developer role at Quest Software. I was involved with a number of projects at Quest including Spotlight on Active Directory, Spotlight on Exchange, as well as research into PowerShell extensions, user provisioning and identity management around cloud computing. I have been working with Operations Manager since MOM 2000, and have been involved with the development of management packs and connectors for both MOM 2005 and SCOM 2007.
For my first post, I'd like to extend Mike's post "Validating and Troubleshooting Unix/Linux Providers" to the Windows world. The information Mike provided was specific to Unix/Linux. I'm going to show you how to perform the same tasks with Windows. This will primarily involve the use of PowerShell.
1) What classes are available in a namespace?
The first step is to enumerate the available classes in a given namespace. The example I've included shows a Windows Server machine with the BridgeWays Management Pack for VMware installed. This will show us all the classes that are modeled in this MP.
Get-WmiObject -Namespace root/bws -list
2) How do you query for instances of a class?
The next step is to specify a class and enumerate all the instances of that class. The example I've chosen shows how to enumerate ESX Hosts (for brevity the screen shot only shows one ESX Host in the enumeration).
Get-WmiObject -Namespace root/bws VMware Host
3) How do you execute commands remotely?
The commands specified above all assume that you are on the machine where the WMI provider is installed, however these commands can also be executed remotely. First, you'll need to make sure that Windows Firewall is configured to allow remote WMI queries. Second, you'll need to specify an additional parameter, the ComputerName parameter.
Get-WmiObject -Namespace root/bws -ComputerName <remoteComputer> VMwareHost
This should give you a good starting point on how to talk to WMI providers outside of SCOM. In my next post, I will expand on the Get-WmiObject command-let and other PowerShell commands to give you more control on the output from these queries.
Hi Rob. As the builtin Get-WmiObject cmdlet does not have an option to specificy timeout, I wrote a replacement function a while ago - maybe you might find it useful http://www.muscetta.com/2009/05/27/get-wmicustom/ And that is for Windows.
I also wrote here http://www.muscetta.com/2009/06/01/using-the-scx-agent-with-wsman-from-powershell-v2/ about how to use Powershell v2 to interact with the Unix XPLat agents.
Posted by: Daniele Muscetta | August 07, 2009 at 03:20 AM
Hi Daniele. That's great info! I've shared this information with my team - I'm sure we'll make great use of this. Thanks!
Posted by: Rob Doucette | August 07, 2009 at 10:24 AM
In my next post, I will expand on the Get-WmiObject command-let and other PowerShell commands to give you more control on the output from these queries.
Posted by: nike shox | May 18, 2010 at 09:46 PM