Join our Newsletter — 33% off our NHI Course
Home› Guides› Service Principal Names for Beginners: How Windows Finds…
Guide Non-Human Identity (NHI)

Service Principal Names for Beginners: How Windows Finds the Right Service Account

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 1 December 2026 9 min read
On this page

A service principal name (SPN) is a unique label that tells Windows which account runs a network service.

This guide is for anyone new to Windows networks or identity work. You do not need to run Active Directory yourself. If your company has file servers, databases or web apps on Windows, it almost certainly uses SPNs.

In short

  • An SPN names one copy of a service, such as a database on one server.
  • Kerberos, the Windows sign-in system, uses the SPN to find the account that service runs as.
  • Many SPNs sit on service accounts, which are non-human identities.
  • Any signed-in user can ask for a ticket to an SPN, so the account behind it needs a long, strong password or a managed account.

What you will learn

  • Explain what an SPN is and why Windows needs one.
  • Read the parts of an SPN such as MSSQLSvc/db01.example.com:1433.
  • Describe how SPNs link services to accounts during sign-in.
  • Know why SPNs on service accounts are a target, and what protects them.
Service label (SPN)
a name for one copy of a service on one computer.
Software account (service account)
an account a program runs as, not a person.
Sign-in ticket (Kerberos ticket)
a locked pass that proves who you are to a service.

What is a service principal name?

Think of a block of flats. The address on the door says which flat it is. The name on the post box says who lives there.

An SPN is like that door address for a service. Microsoft defines it as a unique identifier of a service instance [1]. Kerberos uses it to link that service to the account the service signs in with [1].

This lets your computer ask for a ticket to "the database on db01" without knowing which account runs the database [1].

Where the comparison stops working: one flat can have only one address, but one service can have several SPNs. Microsoft notes a service can register one SPN for each name of its host [1].

Do not mix SPNs up with Microsoft Entra service principals, which are app identities in the cloud. See Entra App Registrations and Service Principals for Beginners for those.

Why does it matter?

If SPNs are wrong, sign-in to services can fail. If the account behind an SPN is weak, it can be a way in for attackers.

If you look after Windows servers

What could happen: a service is moved to a new account, its SPN is left behind, and users cannot sign in to it.

Check this: when a service account changes, its SPNs move to the new account.

Next: Active Directory for Beginners

If you manage identities

What could happen: an old service account with an SPN and a short password is guessed offline.

Check this: every account with an SPN has an owner and a long password, or is a managed account.

Next: Group Managed Service Accounts for Beginners

If you are new to security work

What could happen: you see a burst of ticket requests in the logs and do not know what it means.

Check this: learn what normal ticket requests look like for your services.

Next: Kerberoasting for Beginners

What does it look like?

Microsoft gives the shape as service class, then host, then an optional port and service name [2]. Here is a made-up example.

Example only. All values are made up.

Account:  svc-sql-EXAMPLE                 (1)
SPN:      MSSQLSvc/db01.example.com:1433  (2)
           |        |                |
           class    host             port  (3)
Password last set: 2016-01-01 (FAKE)      (4)
  1. The service account the database runs as. In a real file, this line would contain the account's name in Active Directory.
  2. The SPN registered on that account.
  3. The service class names the kind of service. The host is the computer. The port tells apart copies of one service on one host [2].
  4. When the account's password was last changed.

Why this is risky: the password has not changed in years. Tickets for this SPN are locked with a key from that password, so a weak one can be guessed offline [3].

The safer way: use a managed service account, or set a long password and change it on a schedule.

How does it work?

  1. The service gets an SPN. The SPN is registered on the account the service signs in with. One SPN can sit on only one account [1].
  2. A user wants the service. Their computer finds the service and builds its SPN [1].
  3. The computer asks for a ticket. It sends the SPN to the domain controller, the server that runs sign-in.
  4. The domain controller finds the account. It looks up which account holds that SPN. It returns a ticket locked with a key from that account's password [3].
  5. The service opens the ticket. Only the right account can unlock it, so both sides know they are talking to the right party.
Diagram titled How an SPN connects a user to the right service account. On the left, a User's computer asks for a ticket for MSSQLSvc/db01. An arrow leads to the Domain controller, which looks up the SPN. A side arrow shows the lookup result: the SPN belongs to the account svc-sql. The domain controller returns a ticket locked with svc-sql's key. An arrow leads right to the Database service, which runs as svc-sql and unlocks the ticket. A note at the bottom says a weak password on svc-sql makes its tickets easier to guess offline.
Figure 1. The SPN is how the domain controller knows which account's key to lock the ticket with.

Here is the security angle. MITRE ATT&CK, a public catalogue of attack methods, describes Kerberoasting. A signed-in attacker asks for tickets to SPNs, then tries to crack the locked part offline to learn the service account's password [3]. Tickets that use the older RC4 encryption are the easier target [3].

The defences in that catalogue are simple to state. Use long passwords, ideally 25 or more characters, for service accounts. Consider managed service accounts. Prefer AES encryption over RC4, and give service accounts only the rights they need [3].

A worked example

This story is made up to show the idea.

Celia Zamora is the only IT person at a small engineering firm. A security review flags "service accounts with SPNs" as a finding, and she has no idea what that means.

Elif Falk, a consultant, walks her through it. The firm has three accounts with SPNs. One runs the accounts database, one runs an old intranet site, and one belonged to a backup tool that was removed years ago.

All three accounts are in the domain admins group. Two have passwords set when the servers were built.

They work through the list. The backup tool's account is turned off, then deleted a month later once nothing breaks. The database account moves to a group managed service account, so Windows changes its password itself.

The intranet site cannot use a managed account. Celia sets a long random password and stores it in a vault. She also removes the account from domain admins.

Elif also shows her how to look for event 4769, the ticket request event, in the domain controller logs. Celia now checks for unusual bursts each week.

Celia's lesson: an SPN is just a label. The risk is the account behind it.

Myths and mistakes

What people thinkWhat is true
An SPN is a kind of account.It is a label registered on an account, which links a service to that account[1].
SPNs are the same as Entra service principals.They are different things. SPNs belong to Kerberos in Active Directory. Entra service principals are cloud app identities.
Only admins can ask for tickets to an SPN.Any user with a valid sign-in ticket can request service tickets for SPNs[3].
A normal-length password is fine for a service account.ATT&CK advises service account passwords of ideally 25 or more characters[3].
Old SPNs do no harm.An SPN left on an unused account keeps that account a target. Remove both when the service goes.

What can I do this week?

  • Ask your Active Directory admin for a list of user accounts that have SPNs.
  • For each one, find an owner and the date its password last changed.
  • Mark any that are in admin groups for review.
  • Ask whether any could become group managed service accounts.

Checklist

  • I can explain an SPN as a label that links a service to its account.
  • I can read the class, host and port in an SPN.
  • Every account with an SPN has a named owner.
  • Service accounts use managed accounts or long, random passwords.
  • Service accounts have only the rights they need.
  • AES is preferred over RC4 for Kerberos tickets.
  • SPNs and accounts are removed when a service is retired.

Common questions

Why does Windows need SPNs at all?

Kerberos needs to know which account runs a service, so it can lock the ticket with that account's key. The SPN gives that link, so your computer can ask for a ticket without knowing the account name[1].

Can two accounts have the same SPN?

No. Microsoft says a given SPN can be registered on only one account. If a service changes the account it runs as, its SPNs must be registered again on the new account[1].

Are SPNs dangerous?

Not by themselves. They are normal and needed. The risk comes when the account behind an SPN has a weak password and broad rights, because its tickets can be cracked offline[3].

What is the best fix for a service account with an SPN?

Where the service supports it, use a managed service account, which ATT&CK lists as a defence[3]. Otherwise use a long random password, limit the account's rights and prefer AES.

Where next?

Ready for the detail? Read the practitioner guide: How to Find Kerberoastable Accounts in Active Directory and Fix Them. It shows how to find accounts with SPNs and harden them.

Also useful:

Related NHI Mgmt Group resources: Service Accounts for Beginners, Non-Human Identities for Beginners and Kerberoasting and AS-REP Roasting Defence Guide.

Key terms

SPN
An Active Directory identifier that maps a service instance to the account it runs as, for Kerberos sign-in.
Kerberos
A ticket-based sign-in system that proves identity without sending passwords over the network.
Service account
An account used by software or automated tools rather than a person.
Kerberoasting
An attack that requests Kerberos tickets for service accounts and tries to crack their passwords offline.
Group managed service account
A Windows-managed service identity whose complex password Windows rotates automatically.
SPN abuse
Misuse of service principal names to create or expose accounts that can be Kerberoasted.

Sources and further reading

  1. Microsoft, "Service Principal Names", Microsoft Learn (Active Directory Domain Services). https://learn.microsoft.com/en-us/windows/win32/ad/service-principal-names (accessed 1 Dec 2026).
  2. Microsoft, "Name Formats for Unique SPNs", Microsoft Learn. https://learn.microsoft.com/en-us/windows/win32/ad/name-formats-for-unique-spns (accessed 1 Dec 2026).
  3. MITRE, "Steal or Forge Kerberos Tickets: Kerberoasting (T1558.003)", MITRE ATT&CK. https://attack.mitre.org/techniques/T1558/003/ (accessed 1 Dec 2026).

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.