batch script to check if anyone is logged in to terminal server and then reboot?
I have a .bat file with a simple "shutdown -r" that is run every night at 04:00.
However I wish to change the script so that it checks if anyone is logged in first.
If no users are logged in then continue with the reboot.
If 1 or more users are logged in then it should not reboot.