TExcelTAD
Home › Windows & Active Directory Security › Windows LAPS and Group Managed Service Accounts

Windows LAPS and Group Managed Service Accounts

Two kinds of password cause a large share of AD compromises, and both are passwords that no human should know. The first is the local Administrator password of workstations and servers: set once in the deployment image, identical on every machine, so one machine's SAM hash opens all of them. The second is the service account password: typed by an admin years ago, never changed, often weak, and Kerberoastable. AD has a built-in answer for each. Windows LAPS gives every machine its own random local admin password, rotated and stored in AD; group managed service accounts (gMSAs) give services a domain identity whose password AD itself generates and rotates. Deploying both removes whole branches of the attack graph. This lesson shows how they work, what to check, and how they are attacked when misconfigured.

Windows LAPS

Windows LAPS is built into Windows (since the April 2023 updates for Windows 10, 11 and Server 2019/2022; native in Server 2025) and replaces the older downloadable "legacy LAPS". The machine itself:

  1. generates a random password for a managed local account (by default the built-in Administrator, or a named account),
  2. writes it to its own computer object in AD, in msLAPS-Password (cleartext JSON) or, recommended, msLAPS-EncryptedPassword (encrypted to a group you choose, readable only by its members, with optional password history), and the expiry time in msLAPS-PasswordExpirationTime,
  3. rotates it when it expires, and optionally after each use ("post-authentication actions": reset the password and log the account off a set time after someone used it).

Windows LAPS can also manage the DSRM password of domain controllers, and Windows 11 24H2 and Server 2025 added passphrase and automatic account management options. Legacy LAPS stored the password in ms-Mcs-AdmPwd, protected by being a confidential attribute; domains migrating from it should check that no machine still writes there.

Security depends on who can read the password. With legacy LAPS and cleartext Windows LAPS that is anyone with "All extended rights" or "Read" on the confidential attribute of the computer objects, set per OU. With encryption it is the decryptor group. Whoever can read the passwords of Tier 1 servers is effectively a Tier 1 admin.

gMSAs

A group managed service account (msDS-GroupManagedServiceAccount, Server 2012 and later) is an account whose password the DCs derive from a KDS root key (created once per forest with Add-KdsRootKey), the account and the time. The password is a long random value (256 bytes in published analyses of the msDS-ManagedPassword blob), changed every 30 days by default (msDS-ManagedPasswordInterval), and retrievable only by the computers listed in msDS-GroupMSAMembership (set with -PrincipalsAllowedToRetrieveManagedPassword). A service on those servers runs as CORP\gmsa-sql$ without anyone ever typing or seeing a password. Kerberoasting a gMSA's ticket is hopeless, and its password can't be reused somewhere else because nobody has it.

The risk moves to who may retrieve the password: any principal in the retrieval list can read msDS-ManagedPassword over LDAP and use the account. That list must contain only the servers that run the service (or a group of them), never users.

Windows Server 2025 added delegated MSAs (dMSA), designed to migrate existing service accounts to managed ones. In May 2025 Akamai researchers showed that a principal able to create or write a dMSA object (create-child rights on any OU were enough) could link it to another account and inherit that account's rights, up to Domain Admins ("BadSuccessor"). Microsoft fixed the direct escalation in the August 2025 updates (CVE-2025-53779); keep Server 2025 DCs patched, and still treat create/write rights on dMSA objects and their OUs as Tier 0 and audit changes to their migration-link attributes.

Reviewing coverage and readers

The exports below are shaped like Get-ADComputer -Filter * -Properties msLAPS-PasswordExpirationTime, ms-Mcs-AdmPwdExpirationTime, OperatingSystem and like the LAPS read permissions and gMSA retrieval lists collected per OU and account. The script finds machines without LAPS, machines whose password has not rotated, and principals who can read passwords they shouldn't.

powershell · try it yourself
$today = [datetime]'2026-11-15'
$computers = @'
Name,OU,LapsExpires,LegacyExpires
WS01,Workstations,2026-12-01,
WS02,Workstations,,2026-11-20
WS03,Workstations,,
SQL01,Servers,2026-11-30,
FS01,Servers,2026-07-01,
DC01,Domain Controllers,2026-12-10,
'@ | ConvertFrom-Csv

$readers = @'
OU,Principal
Workstations,CORP\LAPS-Readers-T2
Servers,CORP\LAPS-Readers-T1
Servers,CORP\IT-Helpdesk
Domain Controllers,CORP\Tier0-Admins
'@ | ConvertFrom-Csv

$gmsa = @'
Account,AllowedToRetrieve
gmsa-sql$,CORP\SQL-Servers
gmsa-backup$,CORP\Backup-Servers;CORP\alice
'@ | ConvertFrom-Csv

$tierOfOu   = @{ 'Workstations' = 2; 'Servers' = 1; 'Domain Controllers' = 0 }
$tierOfPrin = @{ 'CORP\LAPS-Readers-T2' = 2; 'CORP\LAPS-Readers-T1' = 1; 'CORP\IT-Helpdesk' = 2; 'CORP\Tier0-Admins' = 0 }

"== LAPS coverage"
foreach ($c in $computers) {
  $state = if ($c.LapsExpires) {
    if ([datetime]$c.LapsExpires -lt $today) { "Windows LAPS, password EXPIRED on $($c.LapsExpires): not rotating" } else { 'Windows LAPS ok' }
  } elseif ($c.LegacyExpires) { 'legacy LAPS only: migrate' } else { 'NO LAPS: shared or static local admin password' }
  "{0,-6} {1}" -f $c.Name, $state
}
"== who can read LAPS passwords"
foreach ($r in $readers) {
  $ouTier = $tierOfOu[$r.OU]; $pTier = $tierOfPrin[$r.Principal]
  $v = if ($pTier -gt $ouTier) { "FINDING: Tier $pTier principal reads Tier $ouTier passwords" } else { 'ok' }
  "{0,-19} {1,-22} {2}" -f $r.OU, $r.Principal, $v
}
"== gMSA retrieval lists"
foreach ($g in $gmsa) {
  $users = $g.AllowedToRetrieve -split ';' | Where-Object { $_ -notmatch 'Servers
  

 }
  $v = if ($users) { 'FINDING: non-server principal can read the password: ' + ($users -join ', ') } else { 'ok' }
  "{0,-13} {1}" -f $g.Account, $v
}
== LAPS coverage
WS01   Windows LAPS ok
WS02   legacy LAPS only: migrate
WS03   NO LAPS: shared or static local admin password
SQL01  Windows LAPS ok
FS01   Windows LAPS, password EXPIRED on 2026-07-01: not rotating
DC01   Windows LAPS ok
== who can read LAPS passwords
Workstations        CORP\LAPS-Readers-T2   ok
Servers             CORP\LAPS-Readers-T1   ok
Servers             CORP\IT-Helpdesk       FINDING: Tier 2 principal reads Tier 1 passwords
Domain Controllers  CORP\Tier0-Admins      ok
== gMSA retrieval lists
gmsa-sql$     ok
gmsa-backup$  FINDING: non-server principal can read the password: CORP\alice

WS03 has no LAPS at all, so its local admin password is whatever the image set, probably shared with others not yet in the export. FS01's password expired in July and was never rotated: the LAPS client isn't running there, or can't write to its object (a permission or connectivity problem worth fixing, and worth investigating). The help desk can read server LAPS passwords, which makes it a Tier 1 admin through the back door. And alice can retrieve the backup gMSA's password: whatever gmsa-backup$ can do (often a lot, for a backup account), alice can do.

How misuse is detected

  • LAPS password reads: with a SACL on computer objects for reads of msLAPS-Password / msLAPS-EncryptedPassword (or ms-Mcs-AdmPwd), 4662 records who read which machine's password. Windows LAPS also logs its own operations in Microsoft-Windows-LAPS/Operational on each machine. A user reading many machines' passwords in a short time is an alert.
  • gMSA password retrieval: 4662 on the gMSA object for msDS-ManagedPassword by a principal that isn't one of the expected servers.
  • Changes to the readers: 5136 on the OU ACLs and on msDS-GroupMSAMembership.
  • Local admin logons: 4624 with the local Administrator account over the network (logon type 3) should be rare; with LAPS and remote UAC restrictions they mostly disappear.

How it is deployed well

  • Windows LAPS on every workstation and member server, with encrypted passwords readable only by a group of the same tier, password history on, post-authentication reset on, and DSRM password management on DCs.
  • Remove legacy LAPS once all machines report Windows LAPS; remove the old read permissions.
  • gMSAs for every service that supports them (most Microsoft server products, scheduled tasks, IIS application pools); retrieval lists limited to a server group.
  • Inventory remaining user-based service accounts, and give each a plan: gMSA, or a long random password in a vault with rotation.

Pitfalls

  • LAPS deployed but readable by Domain Users through an inherited "All extended rights" on the OU.
  • Not monitoring rotation: an expired LAPS password means a machine that has stopped managing itself.
  • gMSA retrieval granted to a user "for testing" and never removed.
  • Applications that don't support gMSAs used as a reason to keep old service accounts with old passwords, instead of giving those accounts strong random passwords.

Practice

1. Why does LAPS break the "one hash opens every machine" path?

Each machine's local admin password is random and unique, so a hash stolen from one machine's SAM works only on that machine, and it changes at the next rotation.

2. Add CORP\Domain Users as a reader of the Workstations OU in the export. What does the script print, and what is the real-world impact?

A new line that says ok: the script's tier table has no entry for Domain Users, so $pTier is $null, and $null -gt 2 is false. That is a bug in the check: unknown principals should be findings. Add 'CORP\Domain Users' = 3 (or treat unknown as a finding). The impact is that every user can read every workstation's admin password.

3. What does an attacker need to use a gMSA, and how do you see it?

To be (or control) a principal in its retrieval list, then read msDS-ManagedPassword over LDAP. With a SACL, 4662 on the gMSA object by that principal reveals it; unexpected retrievers in msDS-GroupMSAMembership are the configuration finding.

Test yourself

What does Windows LAPS manage?

  1. Domain user passwords
  2. A unique, rotated password for a local admin account on each machine, stored on its computer object
  3. The krbtgt key
  4. BitLocker keys only

Who can obtain a gMSA's password?

  1. Anyone in Domain Users
  2. Only the principals in its retrieval list (PrincipalsAllowedToRetrieveManagedPassword)
  3. Nobody, not even the servers
  4. Only the schema master

Why is reading server LAPS passwords a Tier 1 privilege?

  1. It isn't
  2. The password gives local admin on those servers
  3. It allows DCSync
  4. It changes DNS

Which attribute holds Windows LAPS's encrypted password?

  1. ms-Mcs-AdmPwd
  2. msLAPS-EncryptedPassword
  3. unicodePwd
  4. msDS-ManagedPassword