How To Get the Full List of Properties of A PowerShell Object

When querying a PowerShell object, it only returns a few essential properties by default. For example, querying the W32_ComputerSystem class with Get-WmiObject cmdlet only returns properties like Manufacturer, ComputerName, TotalPhysicalMemory, etc.

To get the full list of the properties of Win32_ComputerSystem class, you can pipe the result to Format-List, like below.

Get-WmiObject -Class "Win32_ComputerSystem" | Format-List *

You can even use the wildcard to narrow down the properties you are only interested in, such as below to list all Power-related properties.

Get-WmiObject -Class "Win32_ComputerSystem" | Format-List Power*

If you just needed the list of the properties without the actual value, pipe the result to Get-Member instead.

Get-WmiObject -Class "Win32_ComputerSystem" | Get-Member

But neither would work for the objects that need additional module to get access to. For example, piping the Get-ADComputer cmdlet to Get-Member or Format-List only gets a small subset of properties of an AD computer object.

Get-ADComputer -Filter * | Get-Member.

Instead, use this to get the full list of properties with values.

Get-AdComputer -Filter * -Properties *

Or, pipe the result to Get-Member to just get the full list of available properties. There are a ton of them in AD Computer object.

Get-ADComputer -Filter * -Properties * | Get-Member

Leave a Reply

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