How to Call WMI Class from PowerShell

You can use Get-WMIObject PowerShell cmdlet to call any WMI Class. This PowerShell cmdlet not only allows you to call a WMI Class but you can also query available WMI namespaces on a local or remote computer.

For example, to call WIN32_Service WMI class, use the below command from an elevated PowerShell window:

  • Get-WMIObject Win32_Service

To call WMI Class on a remote computer, use below command:

  • Get-WMIObject Win32_Service –Computer ComputerName

To list all the namespaces, use the –namespace switch as listed in below command:

  • Get-WMIObject –namespace “Root/CIMV2” –list

About Nirmal Sharma

Nirmal is a MCSEx3, MCITP and was awarded Microsoft MVP award in Directory Services. He is specialized in Directory Services, Microsoft Clustering, Hyper-V, SQL and Exchange and has been involved in Microsoft Technologies since 1994. In his spare time, he likes to help others and share some of his knowledge by writing tips and articles. Nirmal can be reached at [email protected].

About The Author

Leave a Comment

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top