Use this when reviewing service accounts and their privileges.
Service Accounts
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.
1. Service accounts run applications.
2. Use gMSA where possible.
3. Long random passwords; no interactive logon.
4. Least privilege; never Domain Admin.
5. Owners and documentation.
service → account → permissions
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Finding risky service accounts Verify boundary
Get-ADUser -Filter {ServicePrincipalName -like '*'} -Properties ServicePrincipalName,PasswordLastSet,AdminCount
Look for accounts with old passwords, AdminCount=1 (privileged), interactive logon rights, or membership in Domain Admins. Prefer gMSAs; otherwise use 25+ character random passwords and deny interactive logon.
Step 2 Common mistakes Narrow the fault
- Service accounts with SPNs and weak passwords (Kerberoastable).
- Service accounts in privileged groups.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Service accounts often have high rights and old passwords.
- Deny interactive logon.
- Prefer gMSAs.
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
ReferenceWhy it matters1 section · depth on demand
Securing service accounts
| Risk | Fix |
|---|---|
| Static, weak passwords (Kerberoasting) | gMSA, or 25+ character random passwords |
| Too many rights | Least privilege; never Domain Admin |
| Interactive logon | Deny logon locally/through RDP |
| Unknown accounts | Inventory with owner and purpose |
Find service accounts with SPNs: Get-ADUser -Filter {ServicePrincipalName -like "*"} -Properties ServicePrincipalName.
ReferenceImportant terms & boundaries2 sections · depth on demand
Hardening settings
| Setting | Purpose |
|---|---|
| gMSA instead of user account | Automatic 120-character password rotation |
| *Deny log on locally / through RDP* | No interactive use |
AES only (msDS-SupportedEncryptionTypes = 24) | Prevent RC4 Kerberoasting |
| No membership in privileged groups | Limit blast radius |
| Logon workstations restriction | Only the servers that run the service |
In depth
Service accounts run services, scheduled tasks and applications. In Active Directory they are frequent targets: often highly privileged, rarely monitored, with old passwords that never change and SPNs that expose them to Kerberoasting.
Hardening service accounts:
| Risk | Control |
|---|---|
| Weak/old passwords | Use gMSA, or 25+ character random passwords with rotation |
| Excessive privileges | Least privilege; never Domain Admin |
| Interactive logon | Deny interactive and RDP logon rights |
| Kerberoasting | gMSA, AES-only encryption types |
| Unknown ownership | Inventory with owner and purpose |
Get-ADUser -Filter 'ServicePrincipalName -like "*"' -Properties ServicePrincipalName, PasswordLastSet, MemberOf |
Select-Object Name, PasswordLastSet, @{n='Groups';e={$_.MemberOf.Count}}
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Active Directory Security → Service Accounts. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/windows/security/ · confidence 94%