Use this when services fail Kerberos due to SPN problems.
SPN
1. setspn -L <account> — SPNs registered.
2. setspn -Q <spn> — which account owns it.
3. Duplicates: setspn -X.
4. Add: setspn -S HTTP/web.contoso.com svc-web.
5. Clients must use that name.
service name → SPN → account whose key encrypts the ticket
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
setspn -L <account>Primary Commands
Configuration and operational commands for this Topic.
setspn -L <account>ReferenceLists the service principal names (SPNs) registered on a user or computer account.
Use when: Kerberos authentication to a service fails and you suspect a missing SPN.
Quick note: For a service running under a domain account, the SPN must be on that account, not on the computer.
Windows / Windows Server / PowerShell · configuration · verifiessetspn -Q <spn>ReferenceSearches the domain for an SPN and shows which account holds it.
Use when: Kerberos fails with a duplicate or missing SPN.
Quick note: A duplicate SPN breaks Kerberos for that service. Use -F to search the whole forest.
Windows / Windows Server / PowerShell · configuration · verifiesVerification & 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 Common mistakes Narrow the fault
- Registering SPNs on the wrong account.
Step 2 Known-good and broken paths Narrow the fault
Known-good: DNS/time/principal scope is correct, credential validation reaches LSASS/domain services as intended, the correct SPN/ticket/token is issued and the protected resource accepts that security context. Broken: authentication can succeed with a fallback mechanism while Kerberos is broken; a ticket can exist for the wrong SPN; a token can be valid yet lack effective authorization at the resource.
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.
- Each SPN must be unique in the forest.
- It is registered on the account the service runs as.
- Every name clients use needs its own SPN.
klist— Kerberos tickets in the sessionklist purge— clear ticketssetspn -Q <spn>— find which account has an SPNnltest /dsgetdc:<domain> /kdc— find a KDCGet-WinEvent -FilterHashtable @{LogName='Security';Id=4768,4769,4771}— KDC events on DCs
ReferenceHow it works2 sections · depth on demand
How it works
Anchor the same user/computer principal, logon session, ticket/token and target SPN/resource across the authentication path. How it works: Windows logon crosses Winlogon/LogonUI or a service logon caller, LSA/LSASS authentication packages, credential validation against local SAM or AD DS, token construction, group/SID expansion and the target service/resource authorization check. Kerberos additionally depends on DNS/DC discovery, time, SPN mapping, TGT/service-ticket exchange and the service accepting the ticket.
State
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Service Principal Names identify service instances for Kerberos: service/host[:port], e.g. HTTP/web01.corp.example.com, MSSQLSvc/sql01.corp.example.com:1433, cifs/fs01.
setspn -L CORP\svc-web # list SPNs on an account
setspn -Q HTTP/intranet.corp.example.com # who owns this SPN
setspn -S HTTP/intranet.corp.example.com CORP\svc-web # add with duplicate check
setspn -X # find duplicates
Duplicate SPNs break Kerberos (KDC cannot choose an account) and cause NTLM fallback. User accounts with SPNs are targets for Kerberoasting — use gMSAs with long random passwords and AES-only encryption.
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 Kerberos → SPN. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/windows-server/security/kerberos/kerberos-authentication-overview · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.