Working with CIM sessions
As mentioned earlier in this chapter, a key feature of the CIM cmdlets is their ability to change how connections are formed and used.
The Get-CimInstance command has a ComputerName parameter, and when this is used, the command automatically creates a session to a remote system using WSMAN. The connection is destroyed as soon as the command completes.
While Get-CimInstance supports basic remote connections, it does not provide a means of authenticating a connection, nor can the protocol be changed.
The Get-CimSession, New-CimSession, New-CimSessionOption, and Remove-CimSession commands are optional commands that can be used to define the behavior of remote connections.
The New-CimSession command creates a connection ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access