< Back

Disconnect-RDUser

Thu Apr 04, 2019 5:41 am

NAME Disconnect-RDUser



SYNOPSIS

Disconnects a user from a session that runs on a remote server.





SYNTAX

Disconnect-RDUser [-HostServer] <String> [-UnifiedSessionID] <Int32> [-Force] [<CommonParameters>]





DESCRIPTION

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.





PARAMETERS

-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.



Required? false

Position? named

Default value none

Accept pipeline input? false

Accept wildcard characters? false



-HostServer <String>

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 (RDSession Host) server. For virtual desktop collections the server name is the name of the Remote Desktop Virtualization Host (RD

Virtualization Host) server.



Required? true

Position? 1

Default value none

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-UnifiedSessionID <Int32>

Provides the unique ID for the session. Use the Get-RDUserSession cmdlet to retrieve the user session ID.



Required? true

Position? 2

Default value none

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS









OUTPUTS

System.Object







Example 1: Disconnect a User from a session on an RD?? Session Host Server



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.







RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=294207

Get-RDUserSession

Invoke-RDUserLogoff

Send-RDUserMessage