Like so many tools, this one was born out of necessity. I needed a quick function to retrieve the model number, serial number, RAM, and OS Bit-level on over 200 workstations. After a bit of head-scratching, I came up with this PowerShell function.
Get-PCInfo is compatible with PowerShell 3.0 or higher. It accepts a hostname, IP, or CSV list as input and gathers information using primarily WMI (which means it may require elevated access). It then outputs a Powershell object that can be piped to cmdlets such as Out-Gridview or Export-Csv.
This is a work-in-progress and I plan to extend it to optionally check the status of services and include much more workstation information. Currently, it provides the following information:
- System Hostname (locally configured hostname)
- System Model Number
- Last logged on account
- Full name of Last logged on account (via domain lookup)
- Amount of Physical Memory
- Operating System Bit-level
- System Serial Number
ExamplesLocal workstation with Format-List
PS C:\> Get-PCInfo | format-list 'Hostname','Model','Serial','RAM','OS-Bitness'
Hostname : TT-WS1716 Model : HP EliteDesk G1 SFF Serial : SFF7D9A56B2 RAM : 8GB OS-Bitness : 64-bit