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
All users except the active users account will be logged off.