How to test if WMI is working with PowerShell

Problem:

How can I test WMI on a remote computer?

Solution:

Get-WmiObject -query "SELECT * FROM Win32_OperatingSystem" -ComputerName ComputerName

One Reply to “How to test if WMI is working with PowerShell”

  1. Hi, one for you to consider, I had a script that did a couple of WMI queries using powershell. one worked, one failed, investigation found that there were only around 500 classes on the machine while a fully functional machine had around 1200. lucky dip on whether your query targets an existing class, so running a query like this isn’t actually a good test as you may just be lucky(or unlucky) with the queries you run.

Leave a Reply

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