Many commands described here are part of the PowerShell remotedesktop module.
So, firstly, you have to import the 'remotedesktop' module
Code: Select all
Import-Module remotedesktop
Code: Select all
Get-Command -Module remotedesktop
Code: Select all
Get-Help <command>
Code: Select all
Get-Help Invoke-RDUserLogoff
BASIC LEVEL OF DETAILS: Get-Help <command> with no other parameters
EXAMPLE: Get-Help <command> -Examples
DETAILED LEVEL OF DETAILS: Get-Help <command> -Detailed
FULL LEVEL OF DETAILS: Get-Help <command> -Full
ONLINE PAGE: Get-Help <command> -Online - this will open a web page from Microsoft website
===========================================
Ends a user session and closes all running applications
Code: Select all
Invoke-RDUserLogoff
===========================================HINT: You should use the -force parameter if you need to close the user's session without asking for confirmation
Disconnect a specified user from a session that runs on the remote server
All applications continue to run.
Code: Select all
Disconnect-RDUser