CmdID / PowerShell / Cmdlets / Get
Get-CimSession
Gets the CIM session objects from the current session. PowerShell reference
From the PowerShell reference
4 parameters
Alias gcms
What it does
Gets the CIM session objects from the current session. By default, the cmdlet gets all of the CIM sessions created in the current PowerShell session. You can use the parameters of Get-CimSession to get the sessions that are for particular computers, or you can identify sessions by their names or other identifiers. Get-CimSession does not get CIM sessions that were created in other PowerShell sessions or that were created on other computers. For more information about CIM sessions, see about_CimSession.
Get-CimSession [[-ComputerName] <String[]>] [<CommonParameters>]Get-CimSession [-Id] <UInt32[]> [<CommonParameters>]Get-CimSession -InstanceId <Guid[]> [<CommonParameters>]Get-CimSession -Name <String[]> [<CommonParameters>]
Get CIM sessions from the current PowerShell session
New-CimSession -ComputerName Server01, Server02
Get-CimSessionIdentifyGet the CIM sessions to a specific computer
Get-CimSession -ComputerName Server02IdentifyGet a list of CIM sessions and then format the list
Get-CimSession | Format-Table -Property ComputerName, InstanceIdIdentifyGet all the CIM sessions that have specific names
Get-CimSession -ComputerName Serv*IdentifyGet a specific CIM session
Get-CimSession -Id 2IdentifyIts page in the reference: Get-CimSession.
Parameters
-ComputerNameSpecifies the name of the computer to get CIM sessions connected to. Wildcard characters are permitted.-IdSpecifies the identifier of the CIM session to get. For multiple IDs, use commas to separate the IDs or use the range operator (..) to specify a range of IDs. An Id is an integer that uniquely identifies the CIM session within the current PowerShell session.
For more information about the range operator, see about_Operators.-InstanceIdSpecifies the instance IDs of the CIM session to get.
InstanceId is a globally-unique identifier (GUID) that uniquely identifies a CIM session. The InstanceId is unique, even when you have multiple sessions running in PowerShell.
The InstanceId is stored in the InstanceId property of the object that represents a CIM session.-NameGets one or more CIM sessions which contain the specified friendly names. Wildcard characters are permitted.