PowerTip: Use the PowerShell 3.0 Get-CimInstance Cmdlet

PowerTip: Use the PowerShell 3.0 Get-CimInstance Cmdlet

  • Comments 2
  • Likes

Summary: Use Windows PowerShell 3.0 to connect to servers running Windows Server 2003 with the Get-CimInstance cmdlet.

Hey, Scripting Guy! Question How can I use Get-CimInstance to connect to servers running Windows Server 2003 in my legacy environment?

Hey, Scripting Guy! Answer Charlotte Windows PowerShell user group member Brian Wilhite says: The new CIM cmdlets use the WSMan protocol by default, which isn’t supported on Windows Server 2003. However, you can use the New-CimSessionOption cmdlet with the Protocol parameter and the New-CimSession cmdlet to create a session for use with Windows Server 2003. Consider the following steps:

1. $SessionOption = New-CimSessionOption -Protocol Dcom

2. $CimSession = New-CimSession -SessionOption $SessionOption -ComputerName WinSrv2003

3. Get-CimInstance Win32_BIOS -CimSession $CimSession

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Great. That goes beyond my expectation...

  • Great info. Very cool.