external help file | Module Name | ms.date | online version | schema | title |
---|---|---|---|---|---|
RemoteDesktop.psm1-help.xml |
RDMgmt |
10/29/2017 |
2.0.0 |
Disconnect-RDUser |
Disconnects a user from a session that runs on a remote server.
Disconnect-RDUser [-HostServer] <String> [-UnifiedSessionID] <Int32> [-Force] [<CommonParameters>]
The Disconnect-RDUser cmdlet disconnects a specified user from a session that runs on the remote server. All applications continue to run.
Use the Invoke-RDUserLogoff cmdlet to end a session and close running applications.
Use the Get-RDUserSessioncmdlet to retrieve the value for the user session ID. Because the user session ID is unique only within the context of a session host, a different session host server can share the same user session ID. The host server and session ID that you specify in this cmdlet uniquely identify a session within a deployment.
PS C:\> Disconnect-RDUser -HostServer sessionhost.contoso.com -UnifiedSessionID 2
This command disconnects the user connected to session 2 on the host server sessionhost.contoso.com.
Disconnects the user from a session on the remote server without prompting the user for confirmation.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the name of the server that hosts the session. For session collections the server name is the name of the Remote Desktop Session Host (RD Session Host) server. For virtual desktop collections the server name is the name of the Remote Desktop Virtualization Host (RD Virtualization Host) server.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Provides the unique ID for the session. Use the Get-RDUserSession cmdlet to retrieve the user session ID.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).