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:
- generates a random password for a managed local account (by default the built-in Administrator, or a named account),
- 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 inmsLAPS-PasswordExpirationTime, - 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.
$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