On Windows 11 and Windows 10, an administrator can restrict when a local account may sign in by running net user with the /times option. For example, /times:M-F,08:00-17:00 permits sign-in from 8 a.m. to 5 p.m. Monday through Friday. Check the result with net user "AccountName" and remove the time restriction with /times:all. The schedule controls sign-in, not total screen time: it does not automatically sign out someone who is already using the account when the permitted hours end.

Infographic showing how Windows’ [ICODE]net user /times[/ICODE] command limits local account sign-ins to scheduled hours. Before changing the account​

This procedure applies to local accounts on the PC where you run the command. It is not a guide to setting hours for a domain account, a Microsoft Family Safety account, or an account on another computer. Microsoft documents net user for both Windows 11 and Windows 10.

Have the following ready:

  • Administrator access. You need an elevated Command Prompt and, if prompted, approval or credentials for an administrator.
  • The local account’s actual username. Its display name on the sign-in screen may not be the name net user expects. The steps below show how to inspect it.
  • A separate, usable administrator account. Make sure you can sign in to that account and elevate a command before restricting the target account. Keep it unrestricted so you can correct or remove the schedule.
  • A schedule in whole-hour increments. For example, 8:00–17:00 is valid; 8:30–17:30 is not a supported whole-hour schedule.
  • The correct PC date, time, and time zone. Check Settings > Time & language > Date & time on either Windows version before testing.

Warning: Do not experiment on your only usable administrator account. An incorrectly entered schedule can prevent that account from signing in when you need it. Also, do not leave the value after /times: blank: Microsoft documents a blank value as preventing sign-in entirely.

The restriction is a recurring weekly schedule. It is not a daily allowance of a certain number of hours, and it does not prevent someone with administrator access from changing the setting. For a meaningful restriction, the person using the target account should not have access to another administrator account.

Windows 10 reached the end of general support on October 14, 2025. Eligible devices may receive security updates through an Extended Security Updates program; the command itself remains available.

Find the account and record its current hours​

  1. Sign in to the separate administrator account. Save any work in the account you intend to restrict; you will later need to sign out of that account to test a new sign-in.
  2. Open an elevated Command Prompt:
    • On Windows 11, open Start, search for Command Prompt, right-click it, and select Run as administrator.
    • On Windows 10, open Start, search for Command Prompt, right-click it, and select Run as administrator.
    Approve the User Account Control prompt or provide administrator credentials. The window should identify itself as an administrator Command Prompt.
  3. List the local user accounts:
    net user
    Find the account you intend to restrict. The examples below use StudyUser; replace it with the actual account name. If the name contains spaces, keep it inside double quotation marks.
  4. Inspect that account:
    net user "StudyUser"
    Check User name to confirm that you selected the intended account. Also note Account active, Account expires, and Logon hours allowed.
  5. Record the existing Logon hours allowed before changing anything. If an existing schedule must be preserved, write down all its days and time ranges so an administrator can restore it later. Setting /times:all removes the time restriction; it does not restore an earlier schedule.

If net user does not identify the account you expected, stop and check with the person who administers the PC. Do not guess based only on a display name or email address.

Set the permitted sign-in hours​

Warning: The following command replaces the account’s permitted-hours schedule. Days not included in the example are not permitted. Check the username and the complete schedule before pressing Enter.

  1. In the elevated Command Prompt, enter:
    net user "StudyUser" /times:M-F,08:00-17:00
    Replace StudyUser with the target local username. This example permits new sign-ins Monday through Friday from 8:00 a.m. until 5:00 p.m.; it does not include Saturday or Sunday.
  2. Look for a success message, then inspect the account again:
    net user "StudyUser"
  3. Read Logon hours allowed. Confirm that the displayed days and hours match your intended schedule. If they do not, correct the command and run it again, or use the rollback procedure below.

You do not need to add a password, /add, or /domain to this command. Those options perform different operations. In particular, /domain targets the computer’s primary domain rather than the local-account task described here.

Choose a different weekly schedule​

Microsoft supports day ranges, individual days, and multiple day-and-time entries. Use whole-hour boundaries, no spaces in the time designations, a comma between a day and its time, and semicolons between separate entries.

For example, to permit sign-in on weekdays from 8 a.m. to 5 p.m. and on Saturday from 9 a.m. to noon:

net user "StudyUser" "/times:M-F,08:00-17:00;Sa,09:00-12:00"

The quotation marks around the complete /times argument make the semicolon-containing argument suitable for either Command Prompt or PowerShell. Continue to quote the username separately if it contains spaces.

Microsoft’s documented abbreviations are:

DayAbbreviation
MondayM
TuesdayT
WednesdayW
ThursdayTh
FridayF
SaturdaySa
SundaySu

Use Th for Thursday rather than T, which represents Tuesday. The examples use 24-hour time; Microsoft also documents 12-hour notation with AM or PM.

Enter the entire desired weekly schedule in one command. Do not assume that a second /times command adds another day to the first one. After each change, inspect Logon hours allowed to make sure the resulting schedule contains every intended interval.

Verify that the restriction works​

Reading the account details confirms what was configured; testing a new sign-in checks the behavior you care about. Keep the separate administrator account available throughout.

  1. While signed in as the administrator, run:
    net user "StudyUser"
    Confirm the target username and the displayed hours. Check that the current day and time fall within the interval you plan to test.
  2. During an allowed period, sign in to the target account using its normal credentials. The expected result is a successful sign-in, provided no other account restriction or credential problem prevents it.
  3. Save any work in the target account. Select Start, select the account picture or account icon, and choose Sign out. Signing out matters: merely switching users leaves the session running, and locking the PC is not the same test as starting a new session.
  4. During a period outside the configured schedule, try a new sign-in to the target account. The expected result is that Windows does not permit that sign-in because it is outside the allowed hours. You may need to wait until a suitable test window.
  5. Sign in to the separate administrator account afterward. If the result is not what you expected, check the account details and the PC clock before changing anything else.

Do not rely on this setting to close an existing desktop session at the end of an allowed interval. If the person signed in at 4:55 p.m. and remains signed in after 5 p.m., /times alone is not a forced sign-out mechanism. Microsoft’s similarly named Network security: Force logoff when logon hours expire policy concerns SMB connections; it is not a substitute for assuming the desktop will be signed out.

Remove or restore the schedule​

Warning: /times:all permits sign-in at any time as far as this account’s logon-hours setting is concerned. Use it only if unrestricted hours are appropriate. Other restrictions, such as a disabled account or an expired account, are separate.

  1. Sign in to the separate administrator account and open Command Prompt with Run as administrator.
  2. Remove the permitted-hours restriction:
    net user "StudyUser" /times:all
  3. Verify the result:
    net user "StudyUser"
    Logon hours allowed should show All.
  4. If the account previously had a restricted schedule that you recorded, restore that schedule instead of leaving it at all. Enter the complete earlier schedule with /times, then inspect the account again. Test a new sign-in at an appropriate time.

This rollback changes the logon-hours setting; it does not delete the account or reset its password.

Troubleshoot an unexpected result​

  • “Access is denied” or the command cannot change the account: Close the window and reopen Command Prompt using Run as administrator. Approve the elevation prompt or supply administrator credentials. Being signed in to an administrator account is not the same as running an elevated command window.
  • The username cannot be found: Run net user without a username, then use the exact local username shown. Put the entire username in double quotation marks if it contains spaces. Confirm that you are working on the intended PC and that the target is a local account.
  • The command reports a syntax error: Check the /times: spelling, the comma between days and hours, and the hyphen in each range. Use whole-hour values such as 08:00-17:00, not half-hour values. For multiple entries, separate them with semicolons and quote the entire /times argument as shown above.
  • The displayed schedule is missing an interval: Re-enter the complete intended week in one command, including each different day-and-time entry. Then run net user "StudyUser" again. A successful command is not a substitute for checking the resulting Logon hours allowed.
  • Sign-in fails during an allowed period: Check Account active and Account expires in the account details, as well as the credentials being used. Also check Settings > Time & language > Date & time for the correct date, time, and time zone. A correct hours schedule does not override an inactive or expired account or another applicable sign-in restriction.
  • The apparent permitted time is unexpected after a time-zone or seasonal clock change: Check the PC’s date, time, time zone, and daylight-saving settings, then inspect Logon hours allowed again and test a new sign-in. Microsoft documents the underlying logon-hours data in GMT, so verify the displayed schedule rather than assuming that a time-zone change leaves the intended local-time behavior unchanged.
  • The user can still use an existing session after hours: That is not proof the schedule failed. Have the user save work and sign out, then test a new sign-in outside the permitted interval. Do not forcibly end a session without allowing for unsaved work.
  • No unrestricted administrator is available: If the affected account can sign in during its next permitted period, wait for that period and use an elevated Command Prompt to inspect or remove the schedule. On an organization-managed PC, contact its IT administrator. If no authorized administrator can sign in or elevate, use the organization’s established recovery process or Microsoft’s Windows recovery guidance rather than attempting an unverified account-bypass procedure.