You could use the qwinsta
and rwinsta
commands to query and disconnect users. Unfortunately, I'm unable to test the remote feature of the commands due to security settings at my current location. But, as per this Tips and Tricks page at Tech Talkz explains, you can definitely do it locally (and remotely, I just can't check if it works as explained)
From a command prompt, perform the following.
Query the connected users:
qwinsta
The command will return 6 columns. We are interested on the SESSIONNAME
, USERNAME
and ID
columns. The SESSIONNAME
you're interested in will contain the string rdp-tcp#
followed by a number. Match that to the USERNAME
you want to disconnect, and note the corresponding ID
column. On to the next step.
Disconnect the user:
rwinsta <ID>
Where <ID>
is the session ID of the user whom you would like to disconnect.
This works for locally connected RDP sessions (e.g. from the computer you want do disconnect the remote user) but hopefully a remote implementation will work better at your location.
Hope that helps.
logoff.exe
..bat
file, and that he would write a "Powershell" script, or some such thing.