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
Category: Miscellaneous
Restart Remote PC with PSExec or PSShutdown
psexec \\machinename -e -u DOMAIN-NAME\username shutdown /s /f /t 30
use /r to restart.
psshutdown \\workstation64 -s
use -r to restart
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.
Teamviewer ID and Version
Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\TeamViewer" -Name ClientID
Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\TeamViewer" -Name Version