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
Known 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.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?