Learn › Windows Server

The Windows Logon Process: Local and Domain Logon with Kerberos

What happens when you sign in to Windows: Winlogon, LSASS, SAM, Kerberos tickets and access tokens – plus the events and commands to fix logon problems.

Advanced 13 min read
By Gopinath Karthikeyan

“I can’t log in” is one of the most common tickets an admin gets. To fix it quickly you need to know who’s involved in a logon and in what order. This guide covers a local logon, a domain logon with Kerberos, and the tools that show you where it went wrong.

The players

Component Job
Winlogon (winlogon.exe) Manages the logon session; reacts to Ctrl+Alt+Del
LogonUI + credential providers Draw the sign-in screen and collect the password, PIN or smart card
LSASS (lsass.exe) Checks the credentials, using an authentication package
Authentication packages Kerberos for domain logons; MSV1_0 (NTLM) for local accounts and fallback
SAM The local account database on every machine
Domain controller (KDC) Checks domain accounts and issues Kerberos tickets

A local logon

  1. You press Ctrl+Alt+Del and enter SRV01\localadmin and a password.
  2. LSASS passes it to MSV1_0, which compares a hash of the password with the one stored in the SAM.
  3. If it matches, LSASS builds an access token: your user SID, your group SIDs (like Administrators) and your privileges.
  4. Winlogon loads your profile and starts userinit.exe, which starts the shell (explorer.exe).

Every program you then start gets a copy of that token – which is why group changes need a new logon to take effect.

A domain logon with Kerberos

First the PC must find a domain controller – that’s the DC locator process. Then Kerberos does the rest:

Domain logon with Kerberos: TGT, service ticket and access to a file server User PC User PC DC (KDC) DC (KDC) FS01 FS01 AS-REQ: user name +timestamp (password key) AS-REQ: user name +timestamp (password key) 1 AS-REP: TGT AS-REP: TGT 2 TGS-REQ: TGT +“I need cifs/FS01” TGS-REQ: TGT +“cifs/FS01 வேண்டும்” 3 TGS-REP: service ticket TGS-REP: service ticket 4 AP-REQ: service ticket AP-REQ: service ticket 5 Access granted (token with group SIDs) Access கிடைத்தது (group SIDs உடன் token) 6 Clocks must be within 5 minutes,and DNS must find the DC Clock 5 நிமிடத்துக்குள், DNSDC-ஐ கண்டுபிடிக்க வேண்டும்
The PC proves the user’s identity to the KDC and gets a TGT, swaps it for a service ticket for FS01, and presents that ticket to the file server.PC user அடையாளத்தை KDC-க்கு நிரூபித்து TGT பெறுகிறது, அதை FS01-க்கான service ticket-ஆக மாற்றி, file server-க்கு காட்டுகிறது.
  1. AS-REQ – the PC sends the user name and a timestamp encrypted with a key derived from the password (pre-authentication).
  2. AS-REP – if the DC can decrypt it, the password is right; it returns a Ticket-Granting Ticket (TGT).
  3. TGS-REQ – to use a service (first the PC itself, later a file server), the PC presents the TGT and asks for a ticket for that service’s SPN, e.g. cifs/FS01.contoso.local.
  4. TGS-REP – the DC returns a service ticket. Inside it is the PAC, the list of the user’s group memberships.
  5. AP-REQ – the PC presents the service ticket to the server.
  6. The server builds an access token from the PAC and checks permissions. The password never crosses the network.

After the tickets, Group Policy for the user applies, logon scripts run and the profile loads.

When the DC can’t be reached

Windows can log a domain user on with cached credentials – a protected copy of the last successful logons (10 by default). That’s why a laptop works off the network, and why a server with a broken network connection may still accept your logon but fail to reach anything.

When NTLM is used instead

Kerberos needs a name and an SPN. Windows falls back to NTLM when you connect by IP address, when the SPN is missing or duplicated, or when there’s no route to a DC. NTLM is older and weaker; many organisations audit or restrict it.

Read the events

Event ID Where Meaning
4624 Target machine, Security log Successful logon – check the Logon Type
4625 Target machine Failed logon – see Status/Sub Status (e.g. 0xC000006A wrong password, 0xC0000234 locked out)
4768 DC TGT requested (AS exchange)
4769 DC Service ticket requested
4771 DC Kerberos pre-authentication failed (usually a wrong password)
4776 DC or machine NTLM credential validation

Logon types in 4624/4625: 2 interactive (console), 3 network (file share), 4 batch (scheduled task), 5 service, 10 RemoteInteractive (RDP), 11 cached interactive.

# Failed logons on this server in the last day
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625; StartTime=(Get-Date).AddDays(-1)} |
  Select-Object TimeCreated, @{n='User';e={$_.Properties[5].Value}}, @{n='Status';e={'0x{0:X}' -f $_.Properties[7].Value}}

Commands for logon problems

whoami /groups          # the groups in your current token
klist                   # your Kerberos tickets
klist purge             # drop them (they're re-requested; or log off and on)
nltest /sc_query:contoso.local          # is the secure channel to the domain OK?
Test-ComputerSecureChannel -Repair -Credential contoso\admin   # fix "trust relationship failed"
setspn -X               # find duplicate SPNs (they break Kerberos)
w32tm /query /status    # check time sync

Common causes, fast

  • Clock difference over 5 minutes → Kerberos fails (KRB_AP_ERR_SKEW). Fix time sync.
  • “The trust relationship between this workstation and the primary domain failed” → the computer account password is out of sync; repair the secure channel.
  • Group change not working → the user needs a new logon (or klist purge for network access).
  • Works by name, not by IP (or the reverse) → Kerberos vs NTLM; check SPNs and NTLM restrictions.
  • Repeated lockouts → find the source with event 4740 on the PDC emulator.

What’s next

Next: DC locator – how clients find a domain controller.

Practise this topic

Test yourself with free questions on this topic – instant answers and explanations.

Start practice questions

Windows ServerActive DirectoryKerberosAuthenticationDeep DiveAdvanced

Gopinath Karthikeyan

Gopinath Karthikeyan – Windows Site Reliability Engineer with about 12 years in enterprise Windows Server infrastructure, and founder of WinOps Academy. YouTube · LinkedIn

More in Windows Server