Script To Kill Terminal Sessions

Rédigé par M Sozezzo - - Aucun commentaire

Save this script on batch file, update server list, and run.

echo off
cls
echo computerName1 >  computers.txt
echo computerName2 >  computers.txt
echo computerName3 >  computers.txt
echo computerName4 >  computers.txt
FOR /F %%A IN (computers.txt) DO (

    echo ------------------------------------------
    echo Check server : %%A
    echo.
    qwinsta /server:%%A
    echo.
    FOR /f "tokens=2" %%i IN ('qwinsta /SERVER:%%A ^| find /i "disc"') DO (
       ECHO %%i | rwinsta %%i /SERVER:%%A /V
    )
    echo.
)

pause
exit


Source : http://serverfault.com/questions/211043/script-to-kill-terminal-sessions

Fil RSS des articles de ce mot clé