Windows Set Domain User Time Limit
The below commands can be run in Command Prompt:
With the above settings, only Logon is restricted. You can enable force log off with below settings:
References:
http://superuser.com/questions/950660/windows-10-how-to-setup-login-time-limits-a-k-a-parental-controls-if-you-d
https://support.microsoft.com/en-us/help/816666/how-to-limit-user-logon-time-in-a-domain-in-windows-server-2003#10
- Enable time restriction
net user joe /times:M-F,3pm-9pm;Sa-Su,9am-11am
- Disable time restriction
net user joe /times:all
- Check current status
net user joe
With the above settings, only Logon is restricted. You can enable force log off with below settings:
- Press Win+R, then type
gpedit.msc
. - Under
User Configuration
->Administrative Templates
->Windows Components
->Windows Logon Options
, click onSet Action to take when logon hours expire
. - Choose
Enabled
, then set the action toLock
orLogoff
, depending on your needs.
- Create a group policy object
- Run Active Directory Users and Computers.
- Right click the respective object, then select Properties.
- Select "Group Policy" tab. Click New
- Enter a name for the policy and then press Enter.
- Click Properties and then Security
- Click to select the Apply Group Policy check box for the groups that you want to have this policy applied. Click OK to finish.
- Enforce logon hour restriction
- Start the Active Directory Users and Computers snap-in.
- In the console tree, right-click your domain or the organizational unit that contains the domain controller GPO that you want to edit, and then click Properties.
- Click the Group Policy tab, select the GPO that you want, and then click Edit.
- Under Computer Configuration - Windows Settings - Security Settings - Local Policies - Security Options.
- In the right pane of the Group Policy snap-in, double-click
Microsoft network server: Disconnect clients when logon hours expire. - Click to select the Define this policy setting check box, click Enabled, and then click
OK. - Close the Group Policy snap-in, and then click
OK.
References:
http://superuser.com/questions/950660/windows-10-how-to-setup-login-time-limits-a-k-a-parental-controls-if-you-d
https://support.microsoft.com/en-us/help/816666/how-to-limit-user-logon-time-in-a-domain-in-windows-server-2003#10
Comments