CIM-Cmdlets Work Against Old Windows Boxes

by Feb 27, 2013

The new CIM cmdlets require PowerShell v3, but you can still remotely target older boxes without PowerShell v3 or PowerShell at all. By default, CIM cmdlets use WSMan for remote connections. If you want to use the old DCOM technique, create a CIMSession and request DCOM.

This piece of code targets the server "storage1" using DCOM, so the remote server can be any Windows box and won't need PowerShell. Just the machine running the PowerShell code needs to have PowerShell v3 in place:

$opt = New-CimSessionOption -Protocol DCOM 
$sd = New-CimSession -ComputerName storage1 -SessionOption $opt 
Get-CimInstance -CimSession $sd -ClassName Win32_BIOS 

Twitter This Tip! ReTweet this Tip!