< Back
Invoke-RDUserLogoff
Post
NAME Invoke-RDUserLogoff
SYNOPSIS
Ends a user session and closes all running applications.
SYNTAX
Invoke-RDUserLogoff [-HostServer] <String> [-UnifiedSessionID] <Int32> [-Force] [<CommonParameters>]
DESCRIPTION
The Invoke-RDUserLogoff cmdlet ends a user session and closes any running applications.
To end a session without closing applications use the Disconnect-RDUser cmdlet.
To get the ID for the user session that you are ending, use the Get-RDUserSession cmdlet. Because the user session ID is unique only within the
context of a session host, a different session within a deploymenthost 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>
Specifies a unique session ID on the host. Use Get-RDUserSession to retrieve the unique ID for a specific user session.
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: End a session connected to an RD?? Session Host server
PS C:\\> Invoke-RDUserLogoff -HostServer "rdsh-1.contoso.com" -UnifiedSessionID 2
This command ends the user session that has the ID 2, which is connected to the host server named rdsh-1.contoso.com.
Example 2: End a session connected to an RD?? Virtualization Host server
PS C:\\> Invoke-RDUserLogoff -HostServer "rdvh-1.contoso.com" -UnifiedSessionID 14 -Force
This command ends the user session that has the ID 14, which is connected to the virtualization host server named rdvh-1.contoso.com. Because the
command includes the Force parameter, it ends the session without prompting for user confirmation.
RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/?LinkId=294235
Disconnect-RDUser
Get-RDUserSession
Send-RDUserMessage
SYNOPSIS
Ends a user session and closes all running applications.
SYNTAX
Invoke-RDUserLogoff [-HostServer] <String> [-UnifiedSessionID] <Int32> [-Force] [<CommonParameters>]
DESCRIPTION
The Invoke-RDUserLogoff cmdlet ends a user session and closes any running applications.
To end a session without closing applications use the Disconnect-RDUser cmdlet.
To get the ID for the user session that you are ending, use the Get-RDUserSession cmdlet. Because the user session ID is unique only within the
context of a session host, a different session within a deploymenthost 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>
Specifies a unique session ID on the host. Use Get-RDUserSession to retrieve the unique ID for a specific user session.
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: End a session connected to an RD?? Session Host server
PS C:\\> Invoke-RDUserLogoff -HostServer "rdsh-1.contoso.com" -UnifiedSessionID 2
This command ends the user session that has the ID 2, which is connected to the host server named rdsh-1.contoso.com.
Example 2: End a session connected to an RD?? Virtualization Host server
PS C:\\> Invoke-RDUserLogoff -HostServer "rdvh-1.contoso.com" -UnifiedSessionID 14 -Force
This command ends the user session that has the ID 14, which is connected to the virtualization host server named rdvh-1.contoso.com. Because the
command includes the Force parameter, it ends the session without prompting for user confirmation.
RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/?LinkId=294235
Disconnect-RDUser
Get-RDUserSession
Send-RDUserMessage