I’m a bit of a night owl. Lately I’ve found myself working late (or not working, but just staying up). When the family is asleep and the sun is down, it’s difficult to tell how much time has passed. I’d like Windows to firmly remind me to go to bed when midnight rolls around.
Windows 10 has parental controls that you may use to enforce time limits or logon hours, but the targeted account must be a designated child account.
It is possible, however, to enforce logon hour limits and force a user to log off when they have crossed a time limit.
Step 1: Set Time Limits for Your Account
Open a privileged command prompt, and use the following command:
net user <username> /time:<day>,<time>
<day>: This is a day or day span. The days are
Sa. A day span would be two days separated by a dash, like
<time>: This is a time span of the time the user should be allowed to log in, such as
You may also have multiple spans of time separated by a semicolon, ala
net user bradford /time:M-F,6am-8am;M-F,4pm-10pm`.
Step 2: Edit Group Policy to Enforce Logon Hours
To lock user session after logon hours expire, run the
Local Group Policy Editorand set action to take when logon hours expire:
- Press Win+R, then type
Windows Logon Options, click on
Set Action to take when logon hours expire.
Enabled, then set the action to
Logoff, depending on your needs.
That’s it! Your account should now lock you out when you’re outside your hours. Go to bed.
- How-To Geek: How to Set Time Limits for a Regular Account in Windows 10
- Superuser: Lock User Session After Logon Hours Expire