PowerShell Logo Small

Remove-CimSession



This is the built-in help made by Microsoft for the command 'Remove-CimSession', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Removes one or more CIM sessions.

SYNTAX


Remove-CimSession [-CimSession] <CimSession[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-CimSession [-ComputerName] <String[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-CimSession [-Id] <UInt32[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-CimSession -InstanceId <Guid[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-CimSession -Name <String[]> [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Remove-CimSession cmdlet removes one or more CIM session objects from the local wps_1 session.



<

RELATED LINKS

Get-CimSession
New-CimSession

REMARKS

<

Examples


Example 1: Remove all the CIM sessions

PS C:\> Get-CimSession | Remove-CimSession



This command retrieves all the available CIM sessions on the local computer using the Get-CimSession cmdlet, and then removes them using the Remove-CimSession.






Example 2: Remove a specific CIM session

PS C:\> Remove-CimSession -Id 5



This command removes the CIM session that has an ID value of 5.






Example 3: Show the list of CIM sessions to remove by using the WhatIf parameterby the parameter

PS C:\>Remove-CimSession -Name a* -WhatIf



This command uses the common parameter WhatIf to specify that the removal should not be done, but only output what would happen if it were done.