PowerShell for Windows Admins

Feb 18 2013   4:32PM GMT

CIM cmdlets and remote access



Posted by: Richard Siddaway
Tags:
PowerShell
PowerShell 3
WMI

When you used the WMI cmdlets

Get-WmiObject -Class Win32_logicalDisk -ComputerName RSLAPTOP01

You were using DCOM to access the remote machine. Even if you accessed the local machine you were using DCOM.

This changes in PowerShell v3 when using the CIM cmdlets.

If you don’t use a computername

Get-CimInstance -ClassName Win32_logicalDisk

You use DCOM to access the local machine.

If you use –computername

Get-CimInstance -ClassName Win32_logicalDisk -ComputerName RSLAPTOP01

You use WSMAN to access the machine named – irrespective of if it is local or remote

A further complication is that the named machine has to be running WSMAN 3.0 i.e. PowerShell v3 is installed.

If you try to access a PowerShell v2 (WSMAN 2.0) machine with the CIM cmdlets you will get an error. The way round that is to create a CIMsession using DCOM as the transport protocol. If you want to learn how to do that you’ll have to wait until after my session at the PowerShell Summit in April or buy a copy of PowerShell and WMI from www.manning.com/siddaway2

I saw a number of people using the CIM cmdlets in the scripting games without thought to connectivity issues like this.

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: