Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Disconnect-RDUser

Disconnect-RDUser

remotedesktop.psm1

Synopsis

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

Syntax

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

Detailed 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>

Disconnects the user from a session on the remote server without prompting the user for confirmation.

Aliases

None

Required?

false

Position

named

Default value

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

Aliases

None

Required?

true

Position

1

Default value

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.

Aliases

None

Required?

true

Position

2

Default value

Accept pipeline input?

True (ByPropertyName)

Accept wildcard characters?

false

Input Type


Return Type

System.Object

Notes

None

Examples

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

This command disconnects the user connected to session 2 on the host server sessionhost.contoso.com.

PS C:\> Disconnect-RDUser -HostServer sessionhost.contoso.com -UnifiedSessionID 2

Online Version
Get-RDUserSession
Invoke-RDUserLogoff
Send-RDUserMessage