PDQ.com mobilePDQ.com desktop
Support

Using PowerShell to extract WMI values

Shane  CorellianShane Corellian
·

If you aren’t using Windows 7 and you haven’t installed Windows PowerShell yet, then go here to download and install.

Here are a couple of useful PowerShell examples for common tasks:

Example of Extracting the Total Physical Memory from WMI   Admin Arsenal

Example of Extracting the Total Physical Memory from WMI

Use PowerShell to directly query WMI | Admin Arsenal

Use PowerShell to directly query WMI

The two examples above show how you can use the “-filter” cmdlet to narrow down the results. In this case we filtered out any device where the DeviceId wasn’t “C:”. The second example shows how you can pass a WMI query using the “-query” cmdlet. In this case we only returned disks that are registered as Fixed Disks (“DriveType = 3″)

You can also query remote computers | Admin Arsenal

You can also query remote computers

Using the “-ComputerName” cmdlet you can specify a remote system. This should work for any object under the “get-WmiObject” cmdlet.

Did you know that PDQ Deploy has a PowerShell step you can use to deploy your scripts?


This blog post is part of a series on Powershell:

Don't miss the next post!

image (42)

PowerShell Get-Command

Get-Command gets the commands from PowerShell modules