Skip to content

Excluding WMI system properties with Powershell


When using Windows Management Instrumentation (WMI)  in your Powershell script you will see a load of system properties returned. These are indicated by a preceding “__” (double underscore) as seen below when issuing get-wmiobject -class “Win32_Processor”:



An obvious attempt to prevent these system properties from being returned would be to use the -ExcludeProperty switch with “__*” specified. As shown though this does not achieve the desired result, the system properties are still returned:



Strangely, well it seems strange to me on initially looking at it, you need to specifically return all properties before you can exclude any:



Now we can see how to exclude those system properties. You may on some occasion wish to return those properties but for the purposes of bringing back information for reports etc. you may wish to exclude them.

Hope this has helped, what interesting uses have you come up with for the information returned from WMI?


From → Powershell

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: