Since the days of Windows XP we have had a utility for testing and exploring WMI, yet in my experience most IT Pros have never heard of it. WBEMTest is a graphical utility that you can use to test connectivity to remote systems, validate your WMI queries and explore WMI. If you are running Microsoft Windows you have everything you need at your fingertips.

Windows Management Instrumentation (WMI) has long been the management technology for Windows based systems. IT Pros have been able to access it from VBScript, the command line using WMIC.EXE, and now PowerShell. Yet WMI can be an elusive creature to tame. You may have a PowerShell tool that uses WMI but doesn’t work as expected. Sometimes the best thing is to get out of whatever tool you are using and look at WMI directly.

Starting WBEMTest ^

To launch the program, the easiest approach is to open the Run dialog box from the start menu and type wbemtest. You should get the screenshot below.

WBEMTest (Windows Management Instrumentation Tester)

WBEMTest (Windows Management Instrumentation Tester)

Unfortunately, there is no way to resize the utility. But let’s see what we can do.

Connecting to a remote computer ^

One of the main challenges with any WMI-based script or tool is connecting and authenticating to remote systems. WMI relies on RPC and DCOM which doesn’t make it very firewall-friendly. The first step therefore is to attempt to connect to a remote computer. Click the Connect button. You should get something like the following screenshot.

WBEMTest - Connect to a remote computer

WBEMTest - Connect to a remote computer

In the Namespace field, enter the path. On newer versions of Windows this defaults to root\cimv2 which is where all of the Win32 classes reside and what most people use. But if you know the path to another namespace, like root\SecurityCenter2 go ahead and use it. The default is the local computer which if that is the case all you need to do is click the Connect button.

For remote computers, prepend the computer name in the namespace path like this: \\server01\root\cimv2. WMI will use your current credentials. But you can specify alternate credentials for remote computers. Enter a username in the format domain\username. Or if connecting to a workgroup machine use the form computername\username. Enter the password and click Connect. You can leave everything else alone. Although for the most secure connection you can set Authentication Level to Packet Privacy.

At this point, if there are any errors connecting to the remote computer, you will get an error message like the RPC server is unavailable or Access is denied.

Error Number 0x800706ba - Facility Win32 - Description - The RPC server is unavailable

Error Number: 0x800706ba – Facility: Win32 – Description: The RPC server is unavailable

 

Error Number 0x8007005 - Facility Win32 - Description Access is denied

Error Number: 0x8007005 – Facility: Win32 – Description: Access is denied

Access denied should be self-explanatory. The credentials you use must have administrator rights.

If the server is not available, it may not be online or there is most likely some sort of firewall issue. If you get an error like this with WBEMTest, no Powershell or VBSCript that is trying to connect to the computer will work. This is where it helps to get out of script. Many people will think they’ve done something wrong with PowerShell when the problem is really WMI. Use WBEMTest to verify connectivity and credentials.

Summary ^

In my experiences training and helping out in forums 80% or more of WMI related problems are traced back to network access issues. Most likely firewall exceptions have not been enabled for WMI remote management or alternate credentials are invalid. So if you are troubleshooting a failing PowerShell command or script that uses Get-WMIObject, pop up WBEMTest and verify connectivity and credentials. In the next part we’ll look at using WBEMTest to validate WMI queries.

+2
Articles in series

WBEMTest

  1. WBEMTest - Part 1: Testing WMI connectivity
  2. WBEMTest - Part 2: WMI queries
  3. WBEMTest - Part 3: Tips and tricks
2 Comments
  1. ruchi 5 years ago

    Hi

     

    is it possible to connect to remote computer using wmi via mac address

    +4

Leave a reply

Please enclose code in pre tags

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2021

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account