IT Best Practice
For Small Business

Nerd Tools


#1. Log off all inactive users:

In notepad paste the following:
@echo off
for /f "tokens=1-7 delims=,: " %%a in ('query user ^| find /i "disc"') do logoff %%b
Save the text document as: logoffusers.cmd 

Then create a scheduled task to run: logoffusers.cmd with any arguments you wish.
All users except the active users account will be logged off.