How to Use Windows PowerShell ‘Get-WmiObject’ for Hardware Audits

The Hidden Hardware Database

When an IT administrator needs to know exactly how much RAM is installed in a specific workstation, or the exact serial number of the motherboard, they usually have to ask the user to reboot into the BIOS or download third-party auditing software.

This is completely unnecessary. Windows maintains a massive, deeply integrated database of every single piece of hardware and software on the machine called WMI (Windows Management Instrumentation).

By using the PowerShell cmdlet Get-WmiObject, administrators can query this database directly from the command line, allowing them to pull precise, scriptable hardware diagnostics instantly-even across a network.

1. Auditing the Processor (CPU)

WMI is organized into different “Classes.” To find information about the CPU, you query the Win32_Processor class.

Get-WmiObject -Class Win32_Processor

This will output a block of data containing the manufacturer (e.g., GenuineIntel), the exact model name (e.g., Intel Core i7-10700K), the current clock speed, and the number of physical cores.

2. Finding the PC Serial Number (For Warranty Claims)

If you need to open a support ticket with Dell or Lenovo, you need the physical serial number (often called the Service Tag) printed on the sticker under the laptop.

You can extract this exact serial number directly from the motherboard firmware using the Win32_BIOS class.

Get-WmiObject -Class Win32_BIOS | Select-Object Manufacturer, SerialNumber, SMBIOSBIOSVersion

This single command is a lifesaver for helpdesk technicians, allowing them to retrieve warranty information without asking the user to crawl under their desk to read a faded sticker.

3. Auditing Physical Memory (RAM)

If you want to know if a computer has enough RAM to run a new piece of software, you can query the Win32_ComputerSystem class.

Get-WmiObject -Class Win32_ComputerSystem | Select-Object TotalPhysicalMemory

Because WMI reports the RAM in raw bytes, the number will look massive (e.g., 17056292864). PowerShell allows you to do math directly in the command to convert it to readable Gigabytes.

Get-WmiObject -Class Win32_ComputerSystem | Select-Object @{Name="RAM (GB)"; Expression={[math]::Round($_.TotalPhysicalMemory/1GB, 2)}}

4. Checking Hard Drive Space and Health

To monitor the storage capacity of all connected local drives (C:, D:, etc.), you query the Win32_LogicalDisk class.

Get-WmiObject -Class Win32_LogicalDisk -Filter "DriveType=3" | Select-Object DeviceID, FreeSpace, Size

(The -Filter "DriveType=3" argument ensures you are only looking at physical hard drives, ignoring network drives and CD-ROMs).

5. Remote Hardware Auditing

The true power of Get-WmiObject is its ability to query remote machines seamlessly.

If you want to pull the serial number of a server named SQL-PROD-01, you do not need to log into it. You simply add the -ComputerName flag to your local PowerShell terminal.

Get-WmiObject -Class Win32_BIOS -ComputerName "SQL-PROD-01" | Select-Object SerialNumber

By wrapping this command in a simple PowerShell loop, you can query a list of 500 computers in your Active Directory and generate a massive CSV inventory report of every single serial number in your enterprise in minutes.

Conclusion

Note: Microsoft has introduced the newer Get-CimInstance cmdlet to eventually replace Get-WmiObject, but the underlying WMI classes (Win32_BIOS, etc.) and syntax remain identical.

WMI is the ultimate source of truth for Windows hardware. By leveraging Get-WmiObject, IT professionals can eliminate third-party auditing tools and build highly customized, automated inventory scripts that manage enterprise hardware fleets flawlessly.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.