got som frozen sessions and needed to logout my user from the rdp session, 

it asks for user input and list the users and session id, next step is to specify the session id and it will logout the user from rdp session

and the user can login to the session again

easy to understand and functional 

a simple frozen rdp session logout from servers remote logoff


a sample from the script as below


$server = read-host "Server Name" 
Query session /server:$server