Restrict Logon Hours for Any Windows Account

January 3, 2023 updated by Admin Leave a reply »

One of my friends complained that his child spends too much time on his computer. He was very worried for his kid’s health. He tried to talk with the child but you know how stubborn they are. It was almost impossible to convince a six-year-old kid that spending too many hours in front of the computer can have a bad influence upon his health condition. I am a person who sustains children should learn how to use computers but I am against excessive use.

Regarding my friend’s problem, I advised him to try software applications that restrict access to computer for a defined time interval. He was reticent about this idea asking me if there was a costless solution. He didn’t want to use software trying to avoid his child getting suspicious. He just wanted a trick to restrict access in Windows without additional software and at no cost.

I immediately thought that the net user command would be perfect for this issue. Follow the steps outlined below to easily limit the user’s logon hours:

  1. Open an elevated Command Prompt.

  2. Enter the appropriate net user /time command for the user(s) you wish to restrict access for.

Example 1:
Limits the user john to logon Monday- Friday between 8am and 5pm:
net user john /time:M-F,08:00-17:00

Example 2:
The same thing can also be expressed as above using the 12 hour clock :
net user john /time:M-F,8am-5pm

Example 3:
This shows the easiest way of setting limits that differ on multiple days.
net user john /time:M,8am-5pm;T,1pm-3pm;W-F,8:00-17:00

Example 4:
To remove time restrictions:
net user john /time:all

Note: The system limits time to one-hour increments, which means you can only restrict the user on the hour (e.g., 13:00 or 1pm, not 13:30 or 1:30pm). You can use the abbreviation for the day (i.e., M,T,W,Th,F,Sa,Su).

Windows accounts can be restricted from logging on to the computer at specific hours or days. You can only restrict when a user can log on to the system, but you cannot force a user to log off when their hours expire.

The next time when you try to log onto the same account, the operating system will check the time restrictions you set to determine if you are allowed to log into the  account. For restricted time periods, the system will required you to enter your password, even if you haven’t set any password on that account. Furthermore, it will always reject you regardless if you enter a valid or invalid password.