How to Secure a Windows Active Directory

Learn how to secure a Windows Active Directory environment with this beginner-friendly guide covering user accounts, Group Policy, auditing, legacy protocol hardening, and real-world security best practices.

CYBERSECURITY How to Secure a Windows Active Directory Environment A Beginner’s Guide — Step-by-Step IlmBytesTech · ilmbytestech.com WINDOWS AD POWERSHELL GROUP POLICY THREAT LEVEL SEC.GUIDE.001 2026
Who this guide is for: IT students, cybersecurity diploma learners, and anyone starting out in Windows administration who wants to understand how to harden an Active Directory environment from the ground up.

Most successful cyberattacks targeting Windows networks don’t start with malware — they start with misconfigured Active Directory environments. Attackers don’t need to break down the door if it’s already unlocked.

Active Directory (AD) is the backbone of most Windows-based enterprise networks. It manages users, computers, permissions, and policies across an organization — which also makes it one of the most targeted systems by attackers. A single misconfigured account or legacy protocol left enabled can hand an attacker the keys to your entire domain.

If you are studying for CompTIA Security+, working toward a cybersecurity diploma, or just getting started in IT, understanding how to secure Active Directory is an essential skill. In this guide, you will learn the key steps to harden a Windows Active Directory environment, with practical commands and Group Policy settings you can apply in a virtual lab or real-world deployment.


1. What is Active Directory and Why Does It Need to Be Secured?

Active Directory Domain Services (AD DS) is a Microsoft directory service that authenticates and authorizes users and computers in a Windows domain network. It stores information about network objects — users, groups, computers, and printers — and provides a centralized way to manage them through Group Policy.

ACTIVE DIRECTORY STRUCTURE 🖥 Domain Controller (Tier 0 — Highest) 📁 OU: IT Admins Organizational Unit 📁 OU: Finance Organizational Unit 📁 OU: HR Organizational Unit 👤 Users 👥 Groups GPO applied here 👤 Users 👥 Groups GPO applied here 👤 Users 👥 Groups GPO applied here Group Policy flows DOWN from DC → OUs → Users & Computers

Why attackers target Active Directory

  • It controls access to virtually everything on the network
  • Compromising a Domain Admin account means full control of the domain
  • Legacy misconfigurations are extremely common in real environments
  • Specialized attack techniques are built specifically to exploit AD weaknesses

Common real-world attacks that target Active Directory:

Kerberoasting
Cracking service account password hashes offline without triggering lockouts
Pass-the-Hash (PtH)
Reusing NTLM credential hashes to authenticate without knowing the plaintext password
DCSync
Mimicking a Domain Controller to pull password hashes directly from AD
BloodHound Enumeration
Mapping all attack paths and privilege escalation routes through AD permissions

Securing AD is not optional — it is a foundational requirement for any organization running Windows infrastructure.

🌍 Real-World Example: In many ransomware attacks — including major incidents at hospitals and government agencies — attackers spend days or weeks quietly moving inside an Active Directory environment, escalating privileges before launching the final attack. Most breaches are not instant. They exploit weak configurations like the ones covered in this guide. By the time ransomware executes, the attacker has often been inside the network for weeks.

New to Active Directory? Start with the basics first: What is Active Directory — then come back to this hardening guide. Also useful: What is Group Policy and our Beginner PowerShell Guide.


01

Secure the Administrator Account

The built-in Administrator account is a well-known target. Because its name is predictable, attackers often target it directly in brute-force and credential-stuffing attacks.

Rename the built-in Administrator account

Open Group Policy Management Console (GPMC) and navigate to:

Computer Configuration → Windows Settings → Security Settings
→ Local Policies → Security Options
→ Accounts: Rename administrator account → Set a non-obvious name

Disable the built-in Administrator account

PowerShell
Disable-LocalUser -Name "Administrator"

Create a dedicated admin account with a unique name

PowerShell
New-ADUser -Name "corp-admin01" -AccountPassword (Read-Host -AsSecureString "Password") `
-Enabled $true -PasswordNeverExpires $false
Add-ADGroupMember -Identity "Domain Admins" -Members "corp-admin01"

Add privileged accounts to the Protected Users group

Members of this group are automatically protected against Pass-the-Hash, Pass-the-Ticket, and other credential theft techniques:

PowerShell
Add-ADGroupMember -Identity "Protected Users" -Members "corp-admin01"

02

Implement the Principle of Least Privilege

Every user and service account should only have the permissions they need to do their job — nothing more. Over-privileged accounts are one of the most common ways attackers move laterally after an initial compromise.

  • Never assign Domain Admin rights to regular user accounts
  • Create separate accounts for administrative tasks vs daily use
  • Review group memberships on a scheduled, regular basis

Audit privileged group memberships

PowerShell
# Check Domain Admins
Get-ADGroupMember -Identity "Domain Admins" | Select-Object Name, SamAccountName

# Check Enterprise Admins
Get-ADGroupMember -Identity "Enterprise Admins" | Select-Object Name, SamAccountName

# Check Schema Admins
Get-ADGroupMember -Identity "Schema Admins" | Select-Object Name, SamAccountName

Any account that does not need to be in these groups should be removed immediately.

Audit delegated permissions in AD

PowerShell
# Show all objects with non-inherited ACLs
Get-ADObject -Filter * -Properties nTSecurityDescriptor |
Where-Object { $_.nTSecurityDescriptor.AreAccessRulesProtected -eq $true }

03

Enforce a Strong Password Policy via Group Policy

Weak passwords are one of the most common entry points for attackers. Group Policy allows you to enforce password complexity requirements across your entire domain from a single location.

Open Group Policy Management

Start → Group Policy Management → Default Domain Policy → Edit
Computer Configuration → Windows Settings → Security Settings
→ Account Policies → Password Policy

Recommended password policy settings

SettingRecommended Value
Minimum password length14 characters or more
Password complexityEnabled
Maximum password age60–90 days
Minimum password age1 day
Enforce password history24 passwords remembered
Store passwords using reversible encryptionDisabled

Apply via PowerShell

PowerShell
Set-ADDefaultDomainPasswordPolicy -Identity "yourdomain.com" `
  -MinPasswordLength 14 `
  -ComplexityEnabled $true `
  -MaxPasswordAge (New-TimeSpan -Days 90) `
  -MinPasswordAge (New-TimeSpan -Days 1) `
  -PasswordHistoryCount 24

Fine-Grained Password Policies for privileged accounts

Fine-Grained Password Policies (FGPP) let you apply stricter rules to specific groups like Domain Admins, without affecting regular users:

PowerShell
New-ADFineGrainedPasswordPolicy -Name "AdminPasswordPolicy" `
  -Precedence 1 `
  -MinPasswordLength 20 `
  -ComplexityEnabled $true `
  -MaxPasswordAge (New-TimeSpan -Days 60) `
  -PasswordHistoryCount 24 `
  -LockoutThreshold 3 `
  -LockoutDuration (New-TimeSpan -Minutes 30) `
  -LockoutObservationWindow (New-TimeSpan -Minutes 30)

Add-ADFineGrainedPasswordPolicySubject -Identity "AdminPasswordPolicy" `
  -Subjects "Domain Admins"

04

Enable and Configure Account Lockout Policy

Account lockout prevents brute-force attacks by disabling an account after a set number of failed login attempts. Without this, an attacker can try unlimited password combinations.

Configure via Group Policy

Computer Configuration → Windows Settings → Security Settings
→ Account Policies → Account Lockout Policy

Recommended lockout settings

SettingRecommended Value
Account lockout threshold5 invalid attempts
Account lockout duration30 minutes
Reset account lockout counter after30 minutes
Note: Setting the threshold too low (e.g., 3 attempts) can cause legitimate users to get locked out frequently. A threshold of 5 balances security and usability well.

Apply via PowerShell

PowerShell
Set-ADDefaultDomainPasswordPolicy -Identity "yourdomain.com" `
  -LockoutThreshold 5 `
  -LockoutDuration (New-TimeSpan -Minutes 30) `
  -LockoutObservationWindow (New-TimeSpan -Minutes 30)

05

Audit and Monitor AD Events

If you are not logging what happens in your AD environment, you will not know when an attack occurs. Windows Event Log is your first line of visibility into what is happening on your domain.

Enable Advanced Audit Policy

Computer Configuration → Windows Settings → Security Settings
→ Advanced Audit Policy Configuration → Audit Policies

Critical audit categories to enable

Audit CategorySetting
Account LogonSuccess and Failure
Account ManagementSuccess and Failure
Logon/LogoffSuccess and Failure
Object AccessFailure
Privilege UseFailure
Policy ChangeSuccess and Failure
Directory Service AccessSuccess and Failure

Enable via command line

CMD (run as Administrator)
auditpol /set /category:"Account Logon" /success:enable /failure:enable
auditpol /set /category:"Account Management" /success:enable /failure:enable
auditpol /set /category:"Logon/Logoff" /success:enable /failure:enable
auditpol /set /category:"Directory Service Access" /success:enable /failure:enable

Key Windows Event IDs to monitor

Event IDDescription
4625Failed logon attempt
4648Logon with explicit credentials
4672Special privileges assigned to new logon
4720A user account was created
4728A member was added to a security-enabled global group
4756A member was added to a universal security group
4771Kerberos pre-authentication failed
4776DC attempted to validate credentials (NTLM)

Query failed logon events with PowerShell

PowerShell
# Find all failed logon attempts in the last 24 hours
Get-WinEvent -FilterHashtable @{
  LogName = 'Security'
  Id = 4625
  StartTime = (Get-Date).AddHours(-24)
} | Select-Object TimeCreated, Message

06

Secure Privileged Accounts with Tiered Access

Microsoft recommends a Tiered Administration Model to limit how far privileged credentials can spread across your environment. The model has three tiers:

Tier 0 — Highest

Domain Controllers, Active Directory, PKI infrastructure. Only Tier 0 admins touch these.

Tier 1 — Servers

Application servers, databases, and enterprise services.

Tier 2 — Workstations

End-user desktops, laptops, and standard devices.

Critical rule: Tier 0 admin accounts must never log into Tier 1 or Tier 2 systems. If a Domain Admin account is used on a compromised workstation, the credential hash can be stolen and replayed by an attacker.
TIERED ADMINISTRATION MODEL TIER 0 — Domain Controllers & AD Only Tier 0 Admins — Never log in from below TIER 1 — Application Servers & Databases Tier 1 Admins only — No Tier 0 creds here TIER 2 — Workstations & End-User Devices Helpdesk Admins only — No Tier 0 or Tier 1 creds
🌍 Real-World Example: The 2020 SolarWinds attack and many ransomware incidents succeeded because attackers obtained Domain Admin credentials on a low-tier workstation. Had tiered access controls been enforced, the blast radius would have been dramatically smaller.

Restrict admin logon rights via GPO

Computer Configuration → Windows Settings → Security Settings
→ Local Policies → User Rights Assignment
→ Deny log on locally → Add Domain Admins (apply on non-DC systems)

Use Privileged Access Workstations (PAWs): Dedicated, hardened machines used only for administrative tasks. Never browse the internet or check email from a PAW.


07

Disable Legacy Protocols

Legacy protocols were designed before modern security requirements existed. They remain enabled by default in many environments and are frequently exploited.

Disable NTLMv1

Computer Configuration → Windows Settings → Security Settings
→ Local Policies → Security Options
→ Network security: LAN Manager authentication level
→ Set to: Send NTLMv2 response only. Refuse LM & NTLM

Disable SMBv1

SMBv1 was exploited in the WannaCry and NotPetya ransomware attacks. There is no reason to have it enabled:

PowerShell
# Check current status
Get-SmbServerConfiguration | Select EnableSMB1Protocol

# Disable SMBv1 on the server
Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force

# Disable via Windows Features on workstations
Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol

Disable LLMNR

LLMNR (Link-Local Multicast Name Resolution) is used by tools like Responder to capture credentials on the network:

Computer Configuration → Administrative Templates → Network
→ DNS Client → Turn off multicast name resolution → Enabled

Disable NetBIOS over TCP/IP

PowerShell
# Disable NetBIOS on all network adapters
$adapters = Get-WmiObject Win32_NetworkAdapterConfiguration
foreach ($adapter in $adapters) {
    $adapter.SetTcpipNetbios(2)  # 2 = Disable NetBIOS
}

08

Keep Domain Controllers Patched and Hardened

Domain Controllers are the most critical servers in your environment. Unpatched DCs are a top target for attackers looking to exploit known vulnerabilities.

  • Apply Windows security updates monthly on Patch Tuesday
  • Do not install unnecessary software or roles on DCs
  • Restrict physical and remote access — only Tier 0 admins should have DC access
  • Do not allow DCs to browse the internet
  • Enable Windows Firewall on all Domain Controllers

Check recent patches via PowerShell

PowerShell
# View the 10 most recently installed hotfixes
Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 10

# Using PSWindowsUpdate module for full update management
Install-Module PSWindowsUpdate
Get-WindowsUpdate

Restrict RDP access to Domain Controllers

Computer Configuration → Windows Settings → Security Settings
→ Local Policies → User Rights Assignment
→ Allow log on through Remote Desktop Services
→ Remove all groups → Add only: DC-Admins (your Tier 0 group)

09

Use the Microsoft Security Compliance Toolkit

Microsoft provides free hardening baselines for Windows Server and Active Directory through the Security Compliance Toolkit (SCT). These baselines are aligned with CIS and NIST standards and give you a tested starting point rather than building policy from scratch.

Download: microsoft.com — Security Compliance Toolkit

The toolkit includes:

  • Pre-built GPO baselines aligned to CIS and NIST standards
  • Policy Analyzer tool to compare your current settings against the baseline
  • LGPO.exe for importing and exporting local policy settings

Basic workflow

  1. Download the baseline for your Windows Server version
  2. Import the GPO into your domain using GPMC
  3. Use Policy Analyzer to identify gaps between your current policy and the baseline
  4. Remediate differences incrementally — do not apply everything at once in production

11. Quick Reference Checklist

Use this checklist when hardening a Windows Active Directory environment:

✅ AD Hardening Checklist
  • Rename and/or disable the built-in Administrator account
  • Add privileged accounts to the Protected Users security group
  • Enforce minimum 14-character passwords with complexity requirements
  • Apply Fine-Grained Password Policies (FGPP) to admin accounts (20+ characters)
  • Configure account lockout — 5 attempts, 30-minute lockout duration
  • Enable Advanced Audit Policy for all critical event categories
  • Monitor key Event IDs: 4625, 4672, 4720, 4728, 4771, 4776
  • Implement the Tiered Administration Model (Tier 0 / 1 / 2)
  • Disable SMBv1, NTLMv1, LLMNR, and NetBIOS over TCP/IP
  • Restrict Domain Admin logon rights to Tier 0 systems only
  • Patch Domain Controllers monthly — no exceptions
  • Apply Microsoft Security Compliance Toolkit baseline GPOs
  • Review Domain Admin and Enterprise Admin memberships on a regular schedule

12. Conclusion

Securing Active Directory is an ongoing process, not a one-time task. Attackers continuously probe for misconfigurations, stale accounts, overprivileged users, and legacy protocols. By following the steps in this guide — strong password policies, least privilege, auditing, disabling legacy protocols, and keeping systems patched — you significantly reduce the attack surface of your AD environment.

As you grow in your cybersecurity career, tools like BloodHound (for AD attack path analysis), Microsoft Defender for Identity, and SIEM platforms will extend your ability to detect and respond to AD-based threats in real time. But the fundamentals covered here are where every IT student and analyst must start.

Leave a Reply

Your email address will not be published. Required fields are marked *