Jump to content
Sign in to follow this  

Testing WMI functionality

Recommended Posts


I'm getting a handle on WMI and how to query. One thing I'd like to do is know if the WMI on a remote PC is running, and if possible, if it's broken.

I tried one possible method of using "wmic os" to check it. But what I found was when I stopped the WMI process and ran "wmic os" on the local PC, it restarted the WMI service, then reported the data. No error messages or anything.

Share this post

Link to post
Share on other sites

As far as WMI service running, you can use something like this:

$objComputer = ObjGet("WinNT://<pcname>,computer")
$objComputer.Filter = 'Array("Service")'

For $aService In $objComputer
 If $aService.Name = "Wmi" Then MsgBox(0, "", $aService.Status)

For whether WMI is working correctly, once you try to query it, you'll receive an error if there is a problem.

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this