Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Using CIMSessions with DCOM vs Get-WMIObject

$
0
0

Hi everyone !

I have this Script which performs a lot of queries/ actions on a SCCM Server using the WMI Classes.

So I was wondering if I use the CIMSession (DCOM protocol) will it be more efficient way to do things ?

As the About_CimSession article says below:

After you create a CimSession object that specifies information required to 
    establish a connection, Windows PowerShell does not establish the 
    connection immediately. When a cmdlet uses the CIM session, 
    Windows PowerShell connects to the specified computer, and then, when the 
    cmdlet finishes, Windows PowerShell terminates the connection.

What are the advantages if I use CIM Sessions in my code ?
One trade-off I can think of is that my script won't be compatible to PowerShell v2 anymore.

If anyone can share some light on this...it will be really helpful.

~Regards~
Dexter





Knowledge is Power{Shell}.


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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