Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 36188

PowerTip: Use the PowerShell 3.0 Get-CimInstance Cmdlet

$
0
0

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


Viewing all articles
Browse latest Browse all 36188

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>