• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1122
  • Last Modified:

Logoff users and/or reboot computers using GPO

Is there any way to forcibly log users off PC's at a specific time/day (e.g. 7pm on a Saturday) using GPO's?  Alternatively or optionally can you force a reboot at a specific time/day using GPO's.
1 Solution
Logon hours needs to be set in the users' account, but you can force logoff through group policy as describe in this article:

As for rebooting you can utilize the schtasks command through their login script like this:
schtasks /create /ru <administrator> /rp <password> /sc dialy /st 23:59:00 /tn shutdown /tr "shutdown /t 0 /r"
But that will require you to put a password in the login script unless the users have admin rights on their workstation.

Alternatively you can create a schedule on your server that reboots all workstations on the LAN by using the tsshutdn or shutdown command (depending on your server version).  Just export all your workstations from ADUC into a text file and prepend the shutdown command to each line.

The policy jekautz mentioned does no local logoff but (as described) causes client sessions with the SMB server to be forcibly disconnected when the client's logon hours expire.

What you are looking for is a scheduled task (that can be deployed using grozup policy preferences)
user: system, password:blank [no, this is no security risk but by design]. Trigger: daily, 7pm.  Action: rwinsta console
That's all.

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now