Define the inventory fields

Capture computer name, OS version, last boot time, memory, IP addresses, disk capacity and free space. Keep the report focused on operationally useful fields.

Collect computer information

Use CIM cmdlets such as Get-CimInstance Win32_OperatingSystem and Win32_ComputerSystem. CIM is preferable to legacy WMI cmdlets for new scripts.

Collect disks and network data

Use Get-CimInstance Win32_LogicalDisk and Get-NetIPAddress to gather capacity and address information.

Handle unreachable servers

Wrap remote calls in error handling and record the failure in a Status or Error column rather than stopping the entire inventory.

Export the report

Use Export-Csv with a timestamped filename and store the report in a controlled location.

Make it reusable

Parameterize the server list, output path and timeout behavior so the same script can run manually or from Task Scheduler.

More practical infrastructure guides

Browse the TechRunbook article library for Windows Server, VMware, Hyper-V, Azure, PowerShell and MABS troubleshooting.

Browse all articles →