Privileged accounts in Active Directory

A three-tier model, separate administrative accounts, Windows LAPS, emergency access accounts and a reversible procedure for removing inactive objects. Protecting domain administrator credentials without a PAM system.

SecurityWindows Server

Domain administrator credentials used on a system with a lower trust level remain in LSASS process memory and allow the whole directory to be taken over without cracking any password. The same applies to a shared local administrator password on workstations built from one image. This document describes a three-tier model in which the boundaries are enforced by user rights assignments in Group Policy, unique local administrator passwords (Windows LAPS), emergency access accounts, and directory maintenance that removes inactive accounts and stale permissions, all without deploying a privileged access management (PAM) system.

Architecture

The tier split follows what compromising a system yields. Anything that allows identity to be taken over across the whole organisation belongs to tier 0, even if it plays the role of an ordinary server. The model matches the classic split that Microsoft develops further in the Enterprise Access Model.

Fig. 1. Accounts of each tier log on only to systems of that tier; domain administrator credentials never touch a workstation.
TierAssetsAccountsPermitted logon source
0domain controllers, certification authority, virtualisation hosts running domain controllers, domain controller backup system, Entra ID synchronisation serverDomain Admins, Enterprise Admins, Schema Admins, adm0-* accountsadministrative workstation or tier 0 jump host
1application servers, databases, file servers, monitoringserver administrators, adm1-* accountsadministrative workstation or tier 1 jump host
2workstations, laptops, printersusers, desktop support, adm2-* accountsworkstations

There is one rule, in both directions: credentials of a higher tier never reach systems of a lower tier, and accounts of a lower tier hold no permissions over objects of a higher tier.

Account and group convention

Every person with administrative privileges has a separate account for each tier they actually operate.

jkowalski          daily account: mail, documents, browser
adm2-jkowalski     workstation support (tier 2)
adm1-jkowalski     server administration (tier 1)
adm0-jkowalski     domain controllers and tier 0 systems

OU=Tier0,OU=Admin,DC=corp,DC=example,DC=com    tier 0 accounts and groups
OU=Tier1,OU=Admin,DC=corp,DC=example,DC=com    tier 1 accounts and groups
GG-Tier1-Admins, GG-Tier2-Support               groups granting permissions

Administrative accounts have no mailbox or Microsoft 365 licence, are not used for web browsing and are not synchronised to Entra ID. adm0 accounts are direct members of Domain Admins, without nesting. The OU=Tier0 unit has permissions limited to tier 0 groups: SDProp protection covers only members of protected groups, not the container or accounts outside those groups.

Enforcing boundaries with user rights in GPO

Boundaries are enforced by configuration, not by administrator discipline. User rights (Computer Configuration › Policies › Windows Settings › Security Settings › Local Policies › User Rights Assignment) are set by policies linked to the workstation and server units.

User rightConstantGPO for the workstation OUGPO for the tier 1 server OU
Deny log on locallySeDenyInteractiveLogonRighttier 0 and 1 groupstier 0 groups
Deny log on through Remote Desktop ServicesSeDenyRemoteInteractiveLogonRighttier 0 and 1 groupstier 0 groups
Deny log on as a batch jobSeDenyBatchLogonRighttier 0 and 1 groupstier 0 groups
Deny log on as a serviceSeDenyServiceLogonRighttier 0 and 1 groupstier 0 groups

The tier 0 groups on these lists are Domain Admins, Enterprise Admins and Schema Admins; the tier 1 group is GG-Tier1-Admins. Denying network access (SeDenyNetworkLogonRight) is introduced as a separate stage, once confirmed not to block the management tools in use.

Deny policies are not linked at domain level, because they would cover the domain controllers. The controllers have their own policy in which the “Allow log on locally” and “Allow log on through Remote Desktop Services” rights are narrowed to the Administrators group; by default the first of these also covers the operator groups on controllers.

Protected Users for tier 0 accounts

At a domain functional level of at least Windows Server 2012 R2, members of the Protected Users group:

  • cannot authenticate with NTLM and do not use DES or RC4 encryption in Kerberos,
  • receive a TGT valid for 4 hours, without renewal,
  • cannot be delegated, either unconstrained or constrained,
  • have no credentials cached on the workstation, so logon without contact with a domain controller does not work.

In scripts and policies the group is referenced by SID with relative identifier 525, because its name may be translated depending on the system language. The group excludes service accounts, computer accounts and the directory emergency access account, which must work even when Kerberos has problems.

Administrative workstation

Logon to tier 0 takes place only from a dedicated administrative workstation or a jump host belonging to tier 0. The minimal version is a virtual machine without a mail client or web browser, with a firewall allowing outbound traffic only to tier 0 systems and a logon right granted only to adm0 accounts.

Windows LAPS: unique local administrator password

Workstations built from one image usually share the same local administrator password. An attacker reads its hash on the first compromised machine and reuses it on the others (pass-the-hash), without cracking anything. Windows LAPS (Local Administrator Password Solution) is built into Windows 10, Windows 11 and Windows Server 2019 and later, with updates from 11 April 2023. On each machine it generates a random password for the chosen local account, rotates it on a schedule and stores it in Active Directory or Microsoft Entra ID. Windows 10 reached end of support on 14 October 2025, and LAPS remains available on it only on devices that still receive updates, for example under the ESU programme (as of October 2026). The legacy LAPS, installed as a separate MSI package, is deprecated; the built-in version adds password encryption in the directory, password history and post-authentication actions.

Directory preparation and Group Policy

Preparing the directory takes three commands from the LAPS module: extending the schema, granting write permission to computers and granting read permission to a chosen group. Permissions are granted separately for each organisational unit containing computers.

Import-Module LAPS
# Once, from an account that is a member of Schema Admins
Update-LapsADSchema
$ou = 'OU=Workstations,OU=Computers,DC=corp,DC=example,DC=com'
# Computers in this OU may write their own password
Set-LapsADComputerSelfPermission -Identity $ou
# Password read access only for the workstation support group
Set-LapsADReadPasswordPermission -Identity $ou -AllowedPrincipals 'CORP\GG-LAPS-Readers'

Read auditing is enabled with Set-LapsADAuditing and the -AuditedPrincipals parameter, which specifies whose reads are recorded. The events go to the security log of the domain controllers, provided the audit policy enables directory service access auditing. Machine behaviour is defined by Group Policy under Computer Configuration › Policies › Administrative Templates › System › LAPS.

SettingValue for workstations
Configure password backup directoryActive Directory
Password Settingsupper and lower case letters, digits, special characters; length 20; age 30 days
Name of administrator account to managenot configured, i.e. the built-in Administrator account
Enable password encryptionEnabled
Configure authorized password decryptorsCORP\GG-LAPS-Readers
Configure size of encrypted password history3
Post-authentication actionsreset password and log off, grace period 8 hours
Do not allow password expiration time longer than required by policyEnabled

Encrypting passwords in the directory requires a domain functional level of at least Windows Server 2016; without it the password is protected only by the permission list on the attribute.

Read permissions and post-authentication actions

Read permission is equivalent to administrator permission on the given machine, so it is granted according to the tier model: desktop support reads workstation passwords, server administrators read application server passwords, and tier 0 machine passwords are read only by tier 0 administrators. In practice this means a separate organisational unit and a separate Group Policy for each tier, because the list of those authorised to decrypt is a policy setting, not an OU setting.

The password of a specific machine is read with Get-LapsADPassword -Identity PC-0142 -AsPlainText or on the LAPS tab in the computer object’s properties. A password read by a person ceases to be secret, so the “Post-authentication actions” setting changes the password and ends the session after logon to the managed account and the grace period. A grace period of 0 hours disables all post-authentication actions.

A machine processes the LAPS policy every hour and records each attempt in the Microsoft-Windows-LAPS/Operational log. Typical causes of a missing password:

SymptomTypical cause
Active computer without a msLAPS-PasswordExpirationTime valuethe policy does not cover its OU or the GPO security filter omits it
Directory write error in the LAPS logSet-LapsADComputerSelfPermission was not run for the OU holding the computer
Password expired for weeksmachine powered off or off the network, with no contact with a domain controller
Support sees the object but not the passwordthe group has read permission but is not authorised to decrypt
Password in the ms-Mcs-AdmPwd attribute instead of the new onesthe account is still managed by legacy LAPS

Once the cause is removed, Invoke-LapsPolicyProcessing forces immediate policy processing on the machine and Reset-LapsPassword changes the password at once, for example after an incident. From a server the same effect comes from Set-LapsADPasswordExpirationTime -Identity PC-0142: the password changes in the next processing cycle.

Network logon denial and domain controllers

The “Deny access to this computer from the network” right with the identifier S-1-5-114 (local account and member of the Administrators group) means that even a known local password does not allow logon over the network. The local administrator is for work at the console when the machine has lost contact with the domain. On domain controllers, the “Enable password backup for DSRM accounts” setting lets LAPS manage the Directory Services Restore Mode (DSRM) password, needed when restoring the directory. The LAPS copy, however, resides in the directory itself, so it does not replace a copy kept outside it.

Emergency access accounts

An emergency access (break-glass) account provides access when logon through the directory stops working, for example after a faulty conditional access policy requiring a compliant device from all users. It works only if it does not depend on the mechanism whose failure it is meant to bypass. It is not used for daily work, and every use triggers an alert and ends with a change of credentials.

SystemEmergency accountCredentialStorage
Entra ID and Microsoft 365two cloud-only accounts with the Global Administrator roletwo FIDO2 keys per accountsafe A and safe B
Active Directoryone domain account in Domain Admins32-character password in two partsparts held by two people, in two safes
Domain controllersDirectory Services Restore Mode passwordpassword, copy through LAPSenvelope in safe A
Virtualisation hostslocal account outside LAPSpasswordenvelope in safe A
Tools that log on through the directorythe tool’s local administratorrandom passwordenvelope or a password manager with independent access
Network deviceslocal account with console accesspasswordenvelope in safe A

Cloud-only accounts in Entra ID

Emergency accounts in the cloud work independently of the on-premises directory, synchronisation and federation:

  • they are created directly in Entra ID, in the onmicrosoft.com domain, and are not synchronised from Active Directory,
  • they hold the Global Administrator role permanently, not through activation in Privileged Identity Management, which may itself require approval or a second factor,
  • they sign in with a FIDO2 key: two keys per account, each in a different safe, with the PIN in the same envelope as the key (a deliberate compromise: each safe must suffice for sign-in when the other is unavailable, and protection comes from the safe, the seal and an alert on every use),
  • they have no methods dependent on one person, such as SMS or an app on a personal phone,
  • they are excluded from conditional access policies that block or restrict sign-in, directly or through a group with static membership, never through a dynamic group; policies in report-only mode need no exclusion, and the account is protected by a phishing-resistant method, not by a policy.

Exclusion from conditional access does not waive MFA when signing in to administrative portals (Azure, Entra, Intune, Microsoft 365) or in Azure management tools (CLI, PowerShell, API) for operations that change resources. Microsoft enforces it independently of those policies, including for emergency accounts; the recommended method is a FIDO2 key (passkey) or certificate-based authentication.

Directory account and local accounts

An emergency account in Active Directory is useful when the directory works but administrator accounts do not: they were locked, disabled on suspicion of compromise, or cannot obtain a Kerberos ticket. It is a direct member of Domain Admins and stays outside the Protected Users group. The built-in Administrator account (RID 500) does not fill this role, because its identifier is widely known. Nor is it disabled; it is secured with account flags and a logon denial in GPO, because during forest recovery it is the only account that signs in without a global catalogue server. The emergency role is filled by a separate, named account.

The password has 32 characters and is split into two parts of 16. Each part is held by a different person, in a separate sealed envelope in a different safe, so using the account requires two people to be present. When the password is changed, both people enter their parts one after the other in the same field, and after a test or use the password is changed with Set-ADAccountPassword -Reset, which prompts for the new password and its confirmation.

A password managed by LAPS resides in the directory and is unreadable when the directory fails. Virtualisation hosts running domain controllers therefore need a separate local account that LAPS does not manage, with the password in an envelope; the same applies to the DSRM password.

Storage, alert and test

Credentials are kept in sealed envelopes, separately for each system, with a list of people authorised to open them, in two safes at different locations. The seal number is recorded in a register, and a broken seal means mandatory replacement of the credentials. A password manager that signs in through the same directory is not a suitable place for emergency credentials unless it has its own independent emergency access.

Every sign-in triggers an alert. In Entra ID the sign-in logs go through diagnostic settings to a Log Analytics workspace, and the alert rule queries the SigninLogs table for both account names every 5 minutes and covers failed attempts as well. The alert is sent by an action group to at least two people, by email and SMS. In Active Directory, authentication of the account leaves event 4768 (Kerberos ticket) or 4776 (NTLM validation) on the controllers, and a failed Kerberos pre-authentication, for example with a wrong password, leaves event 4771. A rule in the log collection system reacts to each of them with the emergency account name, and also to events 4724 (password reset) and 4738 (account change). An account that nobody should use has the simplest possible detection rule: an alert with no reported outage or test is a security incident.

The test is run once a quarter for each system in the table:

  1. A test is logged in the ticketing system, with the date and the names of the people involved.
  2. The envelopes are opened by people on the authorised list, then sign-in and a check of the account’s permissions.
  3. Confirmation that the alert arrived, with the time from sign-in to notification recorded.
  4. The password or key PIN is changed, new envelopes and seals are prepared and a register entry is made (system, account, storage location, date, performer, alert time).

The test checks three things at once: whether the account works, whether the alert arrives and whether the procedure for reaching the safe is feasible in practice.

Directory clean-up

Accounts of people who have left, test accounts with non-expiring passwords and computers that disappeared from the network but still have a valid machine password are entry points that nobody watches. Clean-up needs no third-party tools: PowerShell queries once a month and a procedure in which every change can be reversed for at least 30 days are enough.

Measuring activity

Active Directory stores the last logon date in two attributes. lastLogon is accurate but not replicated: each controller knows only the logons it handled itself. lastLogonTimestamp is replicated but updated only when the stored value is older than the msDS-LogonTimeSyncInterval interval; after a functional level is raised, the documentation counts the first update as 14 days, from which a random part of up to 5 days is subtracted. The value can therefore lag by about two weeks. The LastLogonDate property in PowerShell is the same attribute converted to a date: suitable for clean-up, not for investigation. A threshold shorter than 30 days gives false results, hence 90 days is used; the exact date is read from lastLogon on each controller separately. Computers have an additional indicator: by default they change the machine account password every 30 days, so a PasswordLastSet older than 90 days indicates a machine that has not talked to a controller for a long time.

Problem map

ProblemQueryAction
Inactive user accountsSearch-ADAccount -AccountInactive -TimeSpan 90.00:00:00 -UsersOnlyconfirm with the manager or HR, disable, move to quarantine
Inactive computersSearch-ADAccount -AccountInactive -TimeSpan 90.00:00:00 -ComputersOnlydisable, move, delete after 30 days
Non-expiring passwordSearch-ADAccount -PasswordNeverExpires -UsersOnlypersonal accounts: remove the flag; service accounts: gMSA, or an owner and a password change plan
Service accounts with an SPNGet-ADUser -LDAPFilter '(servicePrincipalName=*)'password of at least 25 characters, owner in the description, gMSA where possible
Empty groupsGet-ADGroup -LDAPFilter '(&(!(member=*))(!(isCriticalSystemObject=TRUE)))'check use in permissions and GPOs, move, delete
adminCount leftoversGet-ADUser -LDAPFilter '(adminCount=1)'compare with protected group membership; on the rest clear the attribute and restore inheritance
Unconstrained delegationGet-ADComputer -Filter 'TrustedForDelegation -eq $true'replace with constrained delegation or remove; acceptable only on domain controllers

Inactive accounts and computers

An account inactive for 90 days is not always abandoned: emergency accounts, service accounts run once a quarter and people on long leave rarely sign in. Disabling is therefore preceded by confirmation with the manager or HR, and exceptions kept in one group (e.g. GG-Cleanup-Exceptions, with the approver and a deadline in the description) are skipped by the script. Disabling an account synchronised to Entra ID blocks new cloud sign-ins after the next synchronisation cycle; tokens issued earlier work until they expire. The mailbox and licence remain until the account is deleted, so the decision on mail forwarding is made before that step.

A computer with old LastLogonDate and PasswordLastSet is usually not working on the network. The exceptions are cluster object accounts (CNO and VCO), machines with computer account password changes disabled (e.g. some VDI) and devices of other operating systems joined to the domain: their dates may be old despite normal operation. Domain controller accounts are skipped entirely.

Non-expiring passwords and service accounts

The PasswordNeverExpires flag on a personal account often marks a temporary solution from years ago; on service accounts it is more common and justified, but requires an owner and a password change plan. Accounts with the servicePrincipalName attribute are particularly important: any authenticated domain user can request a Kerberos ticket for such a service and crack its password offline, without failed logons, and the only trace is event 4769 on the controller. A long random password makes this impractical, and a gMSA with a password rotated by the directory solves the problem completely. The krbtgt account also has an SPN, but it is a system account and is not subject to clean-up.

Empty groups and unconstrained delegation

Empty groups clutter the directory and may be reused. Before deletion, share permissions, GPO security filters and deny groups that are empty by design must be checked. Built-in groups (Domain Users, Domain Computers) look empty because membership through the primary group does not reach the member attribute; the query skips them through isCriticalSystemObject.

A computer with the TrustedForDelegation flag receives the TGTs of all users who authenticate to it, so compromising it gives an attacker the tickets of every administrator who connected to it. Domain controllers have the flag by design; on other machines it is replaced with delegation constrained to specific services.

Procedure: recycle bin, disable, quarantine, delete

Step zero is enabling the Active Directory Recycle Bin (Enable-ADOptionalFeature for the “Recycle Bin Feature” feature at forest scope, forest level at least 2008 R2). Enabling it cannot be undone. A deleted object can then be restored with its attributes and group memberships for the deleted object lifetime, 180 days by default.

Every change starts with a report saved to a file and a run with -WhatIf. Disabling consists of Disable-ADAccount, a description with the disable date (Set-ADComputer or Set-ADUser) and moving the object with Move-ADObject to the quarantine unit. For 30 days the change is reversed with Enable-ADAccount and by moving the object back. The deadline is counted from the date in the description, not from whenChanged: that attribute is not replicated, so it depends on the controller the script talks to. After 30 days, objects whose description date is older than the threshold are removed with Remove-ADObject -Recursive, first with -WhatIf. A computer object may have child objects, e.g. BitLocker recovery keys, which makes Remove-ADComputer fail, and the keys disappear together with the computer; before deletion it must be certain that the disk has been wiped or the key will not be needed.

Decisions and alternatives

ApproachWhen it makes senseLimitation
Tier model in GPO (this document)environment without a PAM budget, a few to a dozen administratorsno just-in-time sessions or session recording; enforcement only on systems in the domain
PAM system with a password vault and session recordingmany administrators, audit requirements, external vendorslicence and maintenance cost; it becomes a tier 0 system itself
Separate administrative forest (ESAE)historically: environments with the highest requirementsMicrosoft no longer recommends it as the default approach; high maintenance cost
LAPS and Protected Users only, without tiersquick reduction of the most dangerous pathsdoes not stop domain administrators from logging on to workstations and servers
Windows LAPS built into the systemnew deployments; encryption, password history, post-authentication actionsencryption requires domain functional level 2016; Windows 10 out of support only with ESU
Legacy LAPS (MSI package)only during migration, in emulation modedeprecated; the installer is blocked by newer system versions
Cloud emergency account with FIDO2access to Entra ID and Microsoft 365 independent of the directorytwo keys in two safes, quarterly test
Emergency access through PIM or a password manager that signs in through the directorynot applicable to emergency accountsactivation and sign-in depend on the mechanism whose failure the account is meant to bypass
AD Recycle Bin before deleting objectsalways during clean-upenabling it cannot be undone; forest level at least 2008 R2

The tier model in GPO does not exclude the others: it is a base layer onto which PAM can be added later without rebuilding the account structure.

Implementation

  1. Inventory: a recursive list of members of privileged groups and of accounts with adminCount=1. Membership often comes through nested groups, and accounts with adminCount=1 outside protected groups are a trace of former privileges.

    $domainSid = (Get-ADDomain).DomainSID.Value
    # RID 512: Domain Admins
    Get-ADGroupMember -Identity "$domainSid-512" -Recursive | Select-Object SamAccountName, objectClass
    Get-ADUser -LDAPFilter '(adminCount=1)' -Properties adminCount | Select-Object SamAccountName, Enabled

    Domain Admins keeps only adm0-* accounts, one emergency account and the built-in Administrator account.

  2. Creating the tier accounts, units and groups, and moving permissions from daily accounts to adm accounts.

  3. Collecting events 4624 for tier 0 and 1 accounts for two to four weeks. Tasks, services and scripts that log on with privileged accounts outside their tier move to service accounts with minimal permissions.

  4. Enabling the deny policies for one unit with a few workstations, then, after verifying events 4625 with code 0xC000015B, for the rest.

  5. Adding tier 0 accounts to Protected Users one at a time, with an observation period after the first account. Adding all Domain Admins members at once may block their logon, which is why Microsoft recommends a staged rollout.

  6. LAPS rollout: directory preparation and Group Policy for a pilot unit, then extension to further tiers with separate read groups. Check: the list of active computers without msLAPS-PasswordExpirationTime (Get-ADComputer with that property) should be empty; a computer with a recent LastLogonDate on the list is a gap, while one inactive for months is a candidate for clean-up. Computers still managed by legacy LAPS (attribute ms-Mcs-AdmPwdExpirationTime) also appear on the list although they have a password. The list of principals with read permission (Find-LapsADExtendedRights for the unit) should contain the system account, Domain Admins and the support group of the given tier; any other principal, for example a broad user group, is a gap.

  7. Emergency accounts: creation, assigning credentials, conditional access exclusions, alert rules and a first test, followed by quarterly tests.

  8. Clean-up: AD Recycle Bin, monthly queries from the problem map, the disable and quarantine procedure; deny policies and reports start with -WhatIf.

Limitations and pitfalls

  • Administrators group on deny lists. On a workstation the identifier S-1-5-32-544 denotes the local administrators group, so a denial would also block the local account managed by LAPS. Only domain groups are placed on deny lists.
  • adminCount=1 after removal from a group. SDProp overwrites permissions of protected group members every 60 minutes and sets the attribute, but after an account is removed from the group the attribute and the disabled inheritance remain. The query also returns current members of privileged groups and krbtgt; the attribute is cleared (Set-ADUser -Clear adminCount) only on accounts outside protected groups, because SDProp would set it again on the others, and inheritance is then restored under Security › Advanced.
  • Read permission without decrypt permission. With LAPS encryption enabled, by default only Domain Admins members can decrypt the password. A support group with read permission that is missing from the “Configure authorized password decryptors” setting gets an object without a password from Get-LapsADPassword, with a lack-of-permission message in the DecryptionStatus field.
  • Systems outside the domain. User rights in GPO do not protect network devices, hypervisors outside the domain or cloud consoles; there tier boundaries require separate accounts and access policies.
  • Emergency access dependent on the directory. A password in LAPS, a password manager that signs in through the directory or role activation through PIM stop working together with the mechanism that failed. Emergency credentials are kept outside the directory and verified in the quarterly test.

Sources