Is there a way to list all servers, that a given user is logged into in the entire active directory?
Something like…:
QueryRdpConnections -user BobAdmin
Result…:
Server
----------------
Web001
Web002
Web003
SQL004
SQL007
active-directoryrdp
Is there a way to list all servers, that a given user is logged into in the entire active directory?
Something like…:
QueryRdpConnections -user BobAdmin
Result…:
Server
----------------
Web001
Web002
Web003
SQL004
SQL007
Best Answer
You can use qwinsta in powershell:
A quick search gets you this article on technet.
I'm using the following part of the script to querry all the active servers and find what users are remotely logged in:
I run it from powershell_ise and just edit on line 22 the $RDPuser -match "%%%" to $RDPuser -match "user1/2/3/" in order to run for a specific user. If you run it as is it will display all users logged in by rdp.