Invoke-RDUserLogoff
適用対象: Windows 10, Windows Server Technical Preview
Invoke-RDUserLogoff
Ends a user session and closes all running applications.
構文
Parameter Set: Default
Invoke-RDUserLogoff [-HostServer] <String> [-UnifiedSessionID] <Int32> [-Force] [-InformationAction <System.Management.Automation.ActionPreference> {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend} ] [-InformationVariable <System.String> ] [ <CommonParameters>]
詳細説明
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.
パラメーター
-Force
ユーザーの確認を求めることなく、コマンドを強制的に実行します。
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
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 |
必須/オプション |
true |
位置 |
1 |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
-InformationAction<System.Management.Automation.ActionPreference>
Specifies how this cmdlet responds to an information event. The acceptable values for this parameter are:
-- SilentlyContinue
-- Stop
-- Continue
-- Inquire
-- Ignore
-- Suspend
Aliases |
infa |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-InformationVariable<System.String>
Specifies a variable in which to store an information event message.
Aliases |
iv |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-UnifiedSessionID<Int32>
Specifies a unique session ID on the host. Use Get-RDUserSession to retrieve the unique ID for a specific user session.
Aliases |
none |
必須/オプション |
true |
位置 |
2 |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByPropertyName) |
ワイルドカード文字の受け入れ |
false |
<CommonParameters>
このコマンドレットは共通のパラメーターをサポートしています(-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、および -OutVariable)。詳細については、TechNet の「 「about_CommonParameters」 (https://go.microsoft.com/fwlink/p/?LinkID=113216) を参照してください。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットが出力するオブジェクトの型です。
- System.Object
使用例
Example 1: End a session connected to an RD Session Host server
This command ends the user session that has the ID 2, which is connected to the host server named rdsh-1.contoso.com.
PS C:\> Invoke-RDUserLogoff -HostServer "rdsh-1.contoso.com" -UnifiedSessionID 2
Example 2: End a session connected to an RD Virtualization Host server
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.
PS C:\> Invoke-RDUserLogoff -HostServer "rdvh-1.contoso.com" -UnifiedSessionID 14 -Force