@echo off
for /f "tokens=1,2,3" %%a in ('qwinsta^|find /i "disc"') do call :process %%a %%b %%c
goto :eof
:process
echo. %1
echo. %2
echo. %3
logoff %2
pause
---------------------------
@echo off
for /f "tokens=2,3" %%a in ('qwinsta^|find /i "Active"') do call :process %%a %%b
goto :eof
:process
set username=%1
set sessionID=%2
echo. Found user: %username% under session ID %sessionID%
pause
if [%username%]=[Administrator] goto :eof
if [%username%] NEQ [] logoff %sessionID%
Thursday, January 13, 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment