Merge pull request #2 from Microsoft/users/vimegh/RDPsessionDisconnect

Script to disconnect the Remote Session without locking the machine
This commit is contained in:
Allen Mathias 2016-08-30 15:12:37 +05:30 коммит произвёл GitHub
Родитель 40c79d8ca6 0c525af944
Коммит b29fdc29c6
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,6 @@
REM This batch script disconnects the Remote Desktop Session without locking the machine. Run with Administrator privileges.
REM Useful in case of running Coded UI Tests where user want to end the remote desktop session but at the same time doesn't want to lock the machine
for /F "usebackq tokens=1" %%f in (`query session ^| findstr /C:^^^>`) do set session="%%f"
set session=%session:~10,-1%
tscon rdp-tcp#%session% /dest:console