Logoff disconnected users on RDS server with powershell

 

When you want to manually logoff disconnected users from a Remote Desktop server, you can first query the server for those disconnected sessions and then logoff those sessions.

Logoff disconnected users on RDS server with powershell:

Or if the list is to long you can query the disconnected sessions:

This script queries the RDS broken for sessions and displays a nice (gridview) form. In this form you can select a user to logoff.

Knipsel

2 comments

  • Ramses Murillo says:

    That is very nice and clean, I seem to need some help though. We have RDS deployed in our environment. I am using the powershell commands as shown below:

    Import-Module RemoteDesktop
    $server = ‘serverX01.contoso.com’ —–Obviously this is a fake name to protect the identity of our servers
    Get-RDUserSession -ConnectionBroker $Server

    and I am getting a message:
    “Get-RDUserSession : A Remote Desktop Services deployment does not exist on
    serverx01.contoso.com”
    I have read a lot of articles that don’t see to offer a clean resolution on this issue. Do you have any ideas what could be the problem?

    Thank you!

     

Leave a Reply

Your email address will not be published. Required fields are marked *