Site icon WindowsLoop

How To Set Login Time Restriction for Any Windows User Account

Have you ever needed to restrict a user’s login access to a specific time and day of the week? It is not often, but there might be times, such as managing children’s screen time or controlling employee device use.

While Windows Parental Controls provide an easy way to set login time restrictions, it requires the user account to be designated as a child account and use a Microsoft account to log in.

However, what if you don’t want to use parental controls but want to set time limits for Windows login? Thankfully, Windows has a needed little Command Prompt trick that lets you set time limits for user account logins.

In this quick and easy guide, let me show you how to set login time restrictions for any user account on Windows. This method works for user accounts using local or Microsoft sign-in.

Table of contents:

  1. Set login time restriction on a user account
  2. Check if a user account has login time restrictions
  3. Remove login time restriction on a user account
  4. Conclusion

Set login time restrictions for any user account

To set time restrictions on when a user can log into their user account, we are going to use the net user command with the \times flag. This command allows you to set one or multiple times and weekdays when a user can login. For example, you can create a login restriction such that the user can only log into their user account only on Saturday and Sunday between 9 AM and 7 PM. Let me show you.

Here’s how to set time limits for user account logins:

First, open the Command Prompt window as admin. To do that, search for Command Prompt in the Start menu and select the Run as Administrator option. You can also open Terminal as admin and then open the Command Prompt tab in it.

In the Command Prompt window, run the below command while replacing the time with time in 12-hour or 24-hour format, day with the weekday in short form (Su – Sunday, M – Monday, T – Tuesday, W – Wednesday, Th – Thursday, F – Friday, Sa – Saturday), and username with the actual account user name.

net user <username> /time:<day>,<time>

For example, if you want to allow a user to only use the computer on Sunday between 4 PM to 8 PM, the command will look like this:

net user <username> /time:Su,4pm-8pm

Just as with time, you can set a weekday range. For example, if you want to allow a user to log into their user account from Monday to Friday between 9 AM to 5 PM, the command will look like this:

net user <username> /time:M-F,9am-4pm

If you want, you can also string multiple date and time limits together. This is helpful if you want to set different time limits for different weekdays. All you have to do is separate the day and time with a ; (semicolon).

net user <username> /time:M-F,9am-4pm;Su,4pm-8pm

As soon as you execute the command, Windows sets the time limit restriction for that specific user account.

From now on, the user can only log in according to the permitted time. If he/she tries to login outside the allowed time, they will get the ‘Your account has time restrictions that prevent you from signing in at this time. Please try again later.’

Check if a user account has login time restriction

If you want to check the time limits of a user account, follow the below steps:

First, open the Command Prompt window as admin. For that, open the Start menu, search for ‘Command Prompt’ in the Start menu, and click the Run as Administrator option. Next, run the net user <username> command. Don’t forget to replace <username> with the actual user name.

After running the command, you will find the login time limits next to the ‘Logon hours allowed’ heading.

Remove login time restriction on a user account

If it’s no longer required to set the login time on a user account. Follow the below steps to remove time limit restrictions on a user account.

First, open the Command Prompt window as admin. For that, open the Start menu, search for ‘Command Prompt’ in the Start menu, and click the Run as Administrator option.

Once the Command Prompt window opens, run the below command while replacing <username> with the actual user account name.

net user <username> /time:all

After running the command, Windows removes all time limits on the user account. You can close the Command Prompt window.

Setting login time restrictions for user accounts — Conclusion

As you can see, using a simple command, you can set time limits on any user account on your Windows computer. All you have to do is execute the net user command with \time flag with weekdays and times. The best thing is this method works on both Microsoft and local accounts.

When you no longer need it, don’t forget to remove the time limits on the user account.

That is all. It is that simple to limit login to a specific time and weekday.

I hope this simple and easy Windows how-to guide helped you.

If you are stuck or need help, email me, and I will try to help as much as possible.

Exit mobile version