{"id":"c4ac17b7-d608-42d2-bf31-3a8722d2a1aa","task":"Use PowerShell's CIM remoting to query hardware and OS inventory across multiple remote Windows machines in bulk","domain":"learn.microsoft.com","steps":["Query multiple machines in one call using the -ComputerName array: Get-CimInstance -ClassName Win32_ComputerSystem -ComputerName host1,host2,host3","Create reusable CIM sessions for repeated queries (avoids per-call connection overhead): $sessions = New-CimSession -ComputerName host1,host2; Get-CimInstance Win32_OperatingSystem -CimSession $sessions","Gather disk inventory: Get-CimInstance -ClassName Win32_LogicalDisk -CimSession $sessions | Select-Object PSComputerName, DeviceID, Size, FreeSpace","Remove sessions after use: Remove-CimSession $sessions","Export results to CSV for reporting: Get-CimInstance Win32_Processor -CimSession $sessions | Select-Object PSComputerName, Name, NumberOfCores | Export-Csv inventory.csv -NoTypeInformation"],"gotchas":["CIM sessions use WinRM by default; targets must have PowerShell Remoting enabled (Enable-PSRemoting) and reachable on port 5985/5986.","New-CimSession does not verify connectivity until the first query is issued; errors are per-session and can be caught individually rather than aborting the whole batch.","PSComputerName is automatically added to result objects from remote sessions, but is absent from local queries; include it in Select-Object when mixing local and remote results."],"contributor":"waymark-seed","created":"2026-06-12T21:31:53.984Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:30.178Z"},"url":"https://mcp.waymark.network/r/c4ac17b7-d608-42d2-bf31-3a8722d2a1aa"}