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.
Explore more TechRunbook guides
Browse practical troubleshooting guides, PowerShell scripts, checklists and infrastructure resources for your environment.
Browse all articles →