Test WMI Query Connection PowerShell

In this post, I describe a quick way to test a WMI connection with a query run using PowerShell.  This can be done from both local and remote machines.


Local Machine

Open PowerShell and run the following example command:

Get-WmiObject -query "SELECT * FROM Win32_OperatingSystem"

Test WMI query with PowerShell

You can replace the query parameter value with other WMI queries.


Remote Machine

To test a WMI connection to a remote machine, open PowerShell and run the following example command, replacing the ComputerName parameter value with the appropriate machine name:

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

Test WMI query with PowerShell remotely


wbemtest

You can also test WMI by running wbemtest (Start > Run > wbemtest).

Press the Connect button, then the Connect button again, then the Query button:

screenshot showing the Windows Management Instrumentation Tester wbemtest

Paste SELECT * FROM Win32_OperatingSystem into the Enter Query textbox, then press the Apply button to see the Query Result:

screenshot showing a query result

This can also be used to test WMI on remote machines by including the machine name in the namespace e.g.

\\DC-2K12R2-DEMO\root\cimv2

screenshot showing a connection to a remote machine

Video

YouTube link: Test WMI Query PowerShell


Related Posts

PackageManagement\Install-Package : No match was found for the specified search criteria and module name

WARNING: Unable to resolve package source 'https //www.powershellgallery.com/api/v2'

The WS-Management service cannot process the request. The service is configured to not accept any remote shell requests.

Set-ExecutionPolicy RemoteSigned PowerShell

Comments

Post a Comment

Popular posts from this blog

LG TV This app will now restart to free up more memory

LG TV Clear All Browsing History Data

Excel Import CSV not using "Use First Row as Headers"