PowerShell Logo Small

Disconnect-WSMan



This is the built-in help made by Microsoft for the command 'Disconnect-WSMan', 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

Disconnects the client from the WinRM service on a remote computer.

SYNTAX


Disconnect-WSMan [[-ComputerName] <String>] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Disconnect-WSMan cmdlet disconnects the client from the WinRM service on a remote computer. If you saved the WS-Management session in a variable, the session object
remains in the variable, but the state of the WS-Management session is "Closed". You can use this cmdlet within the context of the WSMan provider to disconnect the client
from the WinRM service on a remote computer. However, you can also use this cmdlet to disconnect from the WinRM service on remote computers before you change to the WSMan
provider.


For more information about how to connect to the WinRM service on a remote computer, see Connect-WSMan.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=294036
Connect-WSMan
Disable-WSManCredSSP
Enable-WSManCredSSP
Get-WSManCredSSP
Get-WSManInstance
Invoke-WSManAction
New-WSManInstance
New-WSManSessionOption
Remove-WSManInstance
Set-WSManInstance
Set-WSManQuickConfig
Test-WSMan

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

PS C:\>Disconnect-WSMan -computer server01
PS C:\>cd WSMan:
PS WSMan:\>
PS WSMan:\> dir
WSManConfig: Microsoft.WSMan.Management\WSMan::WSMan
ComputerName Type
------------ ----
localhost Container



This command deletes the connection to the remote server01 computer.

This cmdlet is generally used within the context of the WSMan provider to disconnect from a remote computer, in this case the server01 computer. However, you can also use
the Disconnect-WSMan cmdlet to remove connections to remote computers before you change to the WSMan provider. Those connections will not appear in the ComputerName list.