This guide explains how to set logon hours for users in Active Directory using ADUC or PowerShell, including steps to restrict logon times and manage user access.
To set logon hours for a user in Active Directory, you can easily do this through the Active Directory Users and Computers (ADUC) console. Logon hours help you control when a user can access their account. Here’s a step-by-step guide on how to set it up:
You can also set logon hours for a user in Active Directory using PowerShell. Here’s a simple PowerShell script that lets you specify logon hours.
Here’s a basic script to set a user’s login workstation (though it won’t specify exact hours):
Set-ADUser -Identity "username" -LogonWorkstations "workstation1,workstation2"
When it comes to more intricate restrictions on logon hours, it's common to rely on group policies or third-party tools to make sure these rules are enforced.
Logon hours in Active Directory specify the allowed times when a user can log into their account. You can set these restrictions using Active Directory Users and Computers (ADUC) or PowerShell.
To set logon hours, open ADUC, select the user account, go to the Account tab, click Logon Hours, and specify allowed hours on the grid. Click OK to apply.
PowerShell doesn’t natively support detailed logon hour restrictions like the ADUC GUI. However, you can use group policies or third-party tools for more complex restrictions.
No, logon hours only apply to interactive logons (like logging into a computer). They do not restrict non-interactive logons, such as network access or service logons.
Domain administrators can configure logon hours for user accounts in Active Directory using either Active Directory Users and Computers (ADUC) or through Group Policies.