Use this when replacing static service account passwords with managed accounts.
Managed Service Accounts
Managed service accounts (sMSA and gMSA) are AD accounts whose long, random passwords are changed automatically by Windows, removing static service account passwords that are often weak and never rotated.
1. Managed service accounts (sMSA) have automatic password management for one computer.
2. Superseded by gMSA for most cases.
3. No manual passwords.
4. Use for services on single hosts.
5. Check support by app.
AD manages password → host retrieves → service runs
Context & applicabilityCommon mistakes · platform/version boundaries
- Using standalone MSAs where a service runs on several servers (needs gMSA).
- Applications that cannot use MSAs because they ask for a password in a config file.
- Forgetting to grant
PrincipalsAllowedToRetrieveManagedPasswordto the right hosts. - Not checking the KDS root key exists before creating gMSAs.
Operational reference
Fast context before you go deeper.
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.
- Managed accounts rotate long passwords automatically.
- sMSA is for one server; gMSA for many.
- Not every application supports them.
Get-ADServiceAccount -Filter *— MSAsTest-ADServiceAccount <name>— usable on hostInstall-ADServiceAccount <name>— install on host
ReferenceWhy it matters1 section · depth on demand
sMSA vs gMSA
| sMSA | gMSA | |
|---|---|---|
| Used on | One computer | Many computers (farms, clusters) |
| Password | Managed by Windows | Managed by DCs (KDS root key) |
| Typical use | Older single-server services | IIS farms, scheduled tasks, SQL |
Most new deployments use gMSA. Not every application supports managed accounts; check vendor support first.
ReferenceHow it works1 section · depth on demand
In depth
Managed service accounts (MSA and the more common group MSA, gMSA) are AD accounts whose passwords are generated and changed automatically by domain controllers. Services use them without anyone knowing the password, removing password reuse, expiry outages and weak-password risks.
| Type | Use |
|---|---|
| sMSA (standalone) | One computer |
| gMSA | Multiple hosts (clusters, farms, scheduled tasks) |
| dMSA (delegated MSA, Windows Server 2025) | Replaces legacy service accounts with migration support |
Restrict which computers can retrieve each gMSA password, and audit membership of the PrincipalsAllowedToRetrieveManagedPassword group — anyone in it can obtain the account's credentials.
ReferenceConfiguration & state1 section · depth on demand
Commands
Add-KdsRootKey -EffectiveImmediately # lab; production: wait 10 hours
New-ADServiceAccount -Name svc-app -DNSHostName svc-app.corp.local `
-PrincipalsAllowedToRetrieveManagedPassword "APP-Servers"
Install-ADServiceAccount -Identity svc-app # on each host
Documented example, not captured output. Then set the service logon to CORP\svc-app$ with an empty password.
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 → Managed Service Accounts. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/windows/security/ · confidence 94%