PowerShell One-Liner to Query multiple WMI Classes with a CIM Session
Today I thought I would share a one-liner that I recently wrote to query the Manufacturer, Model, and Serial Number information from numerous remote servers. Sounds simple enough, right? This one-liner starts out by using my New-MrCimSession function to create a CIM session to each of the specified servers. This function automatically determines if the remote server supports the WSMan protocol and falls back to DCom if it doesn’t: Get-CimSession | Select-Object -Property Name, ComputerName, Protocol Two different WMI classes are needed to retrieve the necessary information....