MS RDS Cheatsheet PowerShell

Argomenti vari di carattere sistemistico
Post Reply
daniele
Posts: 333
Joined: 04 Mar 2009, 13:59

MS RDS Cheatsheet PowerShell

Post by daniele »

PRE-REQUISITE: the remotedesktop PowerShell module
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
Than, you can have a look at all of them (70+) simply giving this command:

Code: Select all

Get-Command -Module remotedesktop
Lastly, if you need to get help on them, use this command:

Code: Select all

Get-Help <command>
example:

Code: Select all

Get-Help Invoke-RDUserLogoff
Lastly, remember that the Get-Help has 5 level of details
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
Post Reply