Contact Info

Crumbtrail » Administration » Powershell » Powershell 3.0 » Connect-PSSession

Connect-PSSession - Powershell 3.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »


Short description
Reconnects to disconnected sessions

Connect-PSSession [-ThrottleLimit <Int32>] -Name <String[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Connect-PSSession [-ConnectionUri] <Uri[]> [-AllowRedirection] [-Authentication <AuthenticationMechanism>] [-Certificat
eThumbprint <String>] [-ConfigurationName <String>] [-Credential <PSCredential>] [-SessionOption <PSSessionOption>] [-T
hrottleLimit <Int32>] -InstanceId <Guid[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Connect-PSSession [-ComputerName] <String[]> [-ApplicationName <String>] [-Authentication <AuthenticationMechanism>] [-
CertificateThumbprint <String>] [-ConfigurationName <String>] [-Credential <PSCredential>] [-Name <String[]>] [-Port <I
nt32>] [-SessionOption <PSSessionOption>] [-ThrottleLimit <Int32>] [-UseSSL] [-Confirm] [-WhatIf] [<CommonParameters>]
Connect-PSSession [-ApplicationName <String>] [-Authentication <AuthenticationMechanism>] [-CertificateThumbprint <Stri
ng>] [-ConfigurationName <String>] [-Credential <PSCredential>] [-Port <Int32>] [-SessionOption <PSSessionOption>] [-Th
rottleLimit <Int32>] [-UseSSL] -ComputerName <String[]> -InstanceId <Guid[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Connect-PSSession [-ConnectionUri] <Uri[]> [-AllowRedirection] [-Authentication <AuthenticationMechanism>] [-Certificat
eThumbprint <String>] [-ConfigurationName <String>] [-Credential <PSCredential>] [-Name <String[]>] [-SessionOption <PS
SessionOption>] [-ThrottleLimit <Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]
Connect-PSSession [-Id] <Int32[]> [-ThrottleLimit <Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]
Connect-PSSession [-ThrottleLimit <Int32>] -InstanceId <Guid[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Connect-PSSession [-Session] <PSSession[]> [-ThrottleLimit <Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]

The Connect-PSSession cmdlet reconnects to user-managed Windows PowerShell sessions ("PSSessions") that were disconnect
ed. It works on sessions that are disconnected intentionally, such as by using the Disconnect-PSSession cmdlet or the I
nDisconnectedSession parameter of the Invoke-Command cmdlet, and those that were disconnected unintentionally, such as 
by a temporary network outage.

Connect-PSSession can connect to any disconnected session that was started by the same user, including those that were 
started by or disconnected from other sessions on other computers.

However, Connect-PSSession cannot connect to broken or closed sessions, or interactive sessions started by using the En
ter-PSSession cmdlet. Also you cannot connect sessions to sessions started by other users, unless you can provide the c
redentials of the user who created the session.

For more information about the Disconnected Sessions feature, see about_Remote_Disconnected_Sessions.

This cmdlet is introduced in Windows PowerShell 3.0.