How to prevent remote desktop login when user is logged in locally?

Solution 1:

using the group policy editor, browse to:

Administrative Templates\Windows components\Remote desktop services\Remote desktop session host\Connections

look for Set rules for remote control of Remote Desktop Services user sessions and give it Full control with user permission in the options list.

so here the local user is to be promptd for confirmation when someone tries to log in. and it should apply for every login attempt.

Solution 2:

This is impossible. Windows 7 is a consumer OS, not a terminal server.

While the components are there for this to happen, that's only a small part of the story. Realize that software development is more than code. For one, Microsoft has to test the configuration along with application that will run under it. What if an applications try to write to the same registry key? On a terminal server this is easy. On a consumer OS, this is unpredictable. What if one user decides to fire up an application that hogs all the local resources. How to you resolve this?

Even worse are if bugs show up, which potentially can crash the system or worse, silently corrupt data. In a world where you can sue people for serving hot coffee, this is an unnecessary risk.

At best, you'll need to hack it. At worse, you've got to realize that you didn't pay for a terminal server.

Solution 3:

To enable/disable logons on a windows machine (I know it works in 2K+ and win7, not sure about XP)

Change Logon /Disable

Change Logon /Enable

You can build some scripts around these to do what you want.

Be careful tho, if you are working remotely and get DC'ed, someone has to log on to the machine locally to re-enable logons.