Enable / Disable Logon on Terminal Server

You recognize the Situation loged on to a Terminal server to install Programms and disabled users to logon to the Terminal server till you finished and logged of before enabling users o logon to the Terminalserver again. Then use the following command to enable it in the registry.
psexec \\machinename change logon /enable
This will write value 0 in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\WinStationDisabled

Enable Remote Desktop on Remote PC with PSExec

PSExec is part of the Sysinternal Suite and can be downloaded from http://technet.microsoft.com/en-US/sysinternals

psexec \\machinename reg add “hklm\system\currentcontrolset\control\terminal server” /f /v fDenyTSConnections /t REG_DWORD /d 0
psexec \\machinename netsh firewall set service remoteadmin enable
psexec \\machinename netsh firewall set service remotedesktop enable
Use ipadress instead of machinename. Change 0 to 1, to deactivate RDP.