Security · Active Directory Security
Service Accounts
Cheat sheet · https://pcornel.dk/topic.php?topic=4513
Answer
Service accounts run applications and services, often with high privileges and passwords that never change. Use gMSAs, least privilege, deny interactive logon and monitor their use.
Remember
- Service accounts often have high rights and old passwords.
- Deny interactive logon.
- Prefer gMSAs.
First checks
Get-ADUser -Filter {ServicePrincipalName -like '*'} -Properties ServicePrincipalName,PasswordLastSet— service accounts with SPNsGet-ADUser -Filter * -Properties PasswordNeverExpires | ? PasswordNeverExpires— never-expiring passwords- Service account inventory with owners — ownership
Verify in this order
service → account → permissions
Where it usually breaks
First mismatch in identity lifecycle → authenticator/credential → IdP/federation/session → authorization policy → target resource → audit trail; preserve identity/policy/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4513