O'Reilly logo

Windows PowerShell™ 3.0 Step by Step by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Querying WMI

In most situations, when you use WMI, you are performing some sort of query. Even when you are going to set a particular property, you still need to execute a query to return a data set that enables you to perform the configuration. (A data set includes the data that comes back to you as the result of a query—that is, it is a set of data.) In this section, you will examine use of the Get-WmiObject cmdlet to query WMI.

Using the Get-WmiObject cmdlet to query a specific WMI class

  1. Connect to WMI by using the Get-WmiObject cmdlet.

  2. Specify a valid WMI class name to query.

  3. Specify a value for the namespace; omit the -namespace parameter to use the default root\cimv2 namespace.

  4. Specify a value for the -computername parameter; omit the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required