My PC sometime is rebooted overnight by patching process without noticing me, I do not remember which windows servers I remote control login to, I need to logoff those otherwise when my windows password change next time then my account will be locked because those orphaned login. I saved the remote desktop connection manager configuration in a few groups, for example, one group name is others.rdg. I use this power shell command to query the login session on the servers: PS C:\dropit\remotedesktop> findstr "<name>" others.rdg|foreach-object { $_ -replace "<name>","query session /server:"}|foreach-object { $_ -replace "</name>", ""} query session /server:servername1 query session /server:servername2 ... copy and paste the output and run it either in powershell or in dos command, I will have the list of sessions who logon to those windows server, then I can logoff from there. PS C:\dropit\...