• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 126
  • Last Modified:

Deny domain logon to certain AD accounts

There are certain user accounts within our Server 2016 Active Directory domain that we want to remain active but that we don't want these accounts to be able to be used to logon to computers.

Some of these accounts have to exist within Active Directory for the Office 365 email accounts to exist (since we are using Office 365 AD synchronization) and others are used simply for network services (so that we don't have to use the Administrator account).

How can we make it so that these AD accounts won't be able to be used to logon to our domain joined computers?
IT Guy
IT Guy
3 Solutions
Scott CSenior Systems EnginerCommented:
Go to the properties of the account in ADUC and click on the "Account" tab.

Click on "Logon Hours..." and select "Logon Denied".  Click on Ok twice and you are done.
Adam BrownSr Solutions ArchitectCommented:
Or use the User Rights Assignment features of Group Policy: https://4sysops.com/archives/deny-and-allow-workstation-logons-with-group-policy/ explains what to do. This gives you the ability to block logon to computers directly or through RDP, but still allow the account to be used as a service account or remotely through powershell.

Scott's recommendation would work for the Office 365 accounts (since logontimes is not replicated through AD Connect), but would not work for securing network services. You would need to set User Rights to allow logon as a batch or service and deny local and remote desktop login.
Todd NelsonSystems EngineerCommented:
Scott provides a great option that I previously had not attempted.  I just confirmed it works by allowing my test user to login to the EXO mailbox but not to an domain-joined workstation.

Thanks, Scott.
Naveen SharmaCommented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now