query session |find /i "tcp#" | find /v /i "administrator" >session.txt
for /f "skip=1 tokens=3," %%i in (session.txt) DO logoff %%i
del session.txt
cd\
cd temp
userslogoff.cmd
Logoff command do not prevent uses for new logins, use command to disable new logins:
change logon /disable
Logons are re-enabled when you restart the system or use command to enable:
change logon /enable
/Geecoholic
No comments:
Post a Comment