Logout of user profile without need for manual intervention

Logout of user profile without need for manual intervention

avatar

At my organization (a library), we have quite a few public computers that automatically boot up and logon to a guest account. If I try to remote into one of those computers while no one is using it to do some updates, I receive a screen that says "Another user is logged on to this computer. If you continue, this user has to disconnect from this computer. Do you want to continue?" At this point, I physically have to walk out to that computer a verify that I want to allow a remote session. What I am wondering is if there is a way I can force the remote computer to log off the guest account so that I can remote in as an admin without having to manually intercede?

All Comments (4)

avatar

Nevermind, It's evidently not possible using Microsoft's built in RDP.

avatar

Maurice

avatar

You can forcibly disconnect the sessions remotely as long as you have your admin account running in Admin mode.

Maybe some sort of macro as a pre-connection idea in RDM..
for /f "tokens=1*" %%f in ('qwinsta /server:$HOST$') do if %%i == Active tsdiscon %%h /server:$HOST$

That will automatically disconnect the active session (assuming a single user workstation). If you are connecting to a multi-user workstation (RDS etc.) that that would disconnect everyone.

David F.

avatar















Thank you, David. I will have to try this. What I came up with is to use the CMD prompt to logoff the guest user, which of course disconnects that particular session. However, this allows me to make a new RDP connection using my Admin credentials. It seems work pretty well.

I work at a library and all the publicly available PCs auto-login to a guest account. I needed to be able remote in to issues updates and perform occasional maintenance.


Thanks again!