Windows internals for admins
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Core administration and security
-
Phase 3: Enterprise infrastructure
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
When a server misbehaves, an admin who knows what’s running underneath usually finds the cause in minutes, while one who doesn’t just restarts things and hopes. This lesson gives you enough Windows internals to be the first kind.
We’ll look at processes, services and the accounts they run as, find where service settings live in the registry, follow Windows through its boot, and see where the event logs are kept. All the troubleshooting lessons in Phase 4 build on this.
| Time | You need | By the end you can |
|---|---|---|
| About 50 minutes | DC01 from Lesson 7, PowerShell as administrator | Tell processes and services apart, read a service’s account, path and dependencies, find its registry key, explain the boot sequence, and locate the event log files |
What it is, in one line
Windows internals are the moving parts under the desktop, meaning the kernel, processes, services, the registry and the boot sequence that starts it all.
In Simple Words
A hotel, behind the front desk
Hotel guests only ever see the front desk and their room. Behind the scenes the place runs on staff who keep working whether anyone’s watching or not, in housekeeping, the kitchen, security and the laundry. Each of them has a job and a uniform that says what they’re allowed to touch, and some can’t start until others have (the kitchen needs the gas on first).
In the manager’s office there’s a big binder with every rule in it, who starts when and who reports to whom, and every morning the hotel opens up in the same order: lights first, then security, then the front desk.
In Windows terms, the staff are services and their uniforms are service accounts, the binder is the registry and the morning routine is the boot sequence.
Engineer's View
Processes, services, accounts, registry and boot
Processes are running programs, and each has its own memory and an ID (PID). Some run in your session, while system processes run in session 0, which no user ever signs in to. The ones to know are lsass.exe (sign-in and security), services.exe (starts and stops services), wininit.exe and winlogon.exe (startup and the sign-in screens), plus lots of svchost.exe processes that host services.
Services are background programs that run without anyone signed in, and the Service Control Manager starts them. Each one has a start type (Automatic, Automatic (Delayed Start), Manual, Disabled), dependencies on other services, recovery actions for when it crashes, and an account it runs as.
Service accounts: LocalSystem can do almost anything on the machine. LocalService has few rights and is anonymous on the network, while NetworkService has few rights locally but uses the computer’s identity on the network. Apps that need an identity of their own run as domain or managed service accounts (Lesson 22).
svchost.exe is a host process for services that are written as DLLs.
On servers with plenty of memory, most services get a svchost of their own, though some still share. Below about 3.5 GB of memory, as on your 2 GB lab VMs, Windows groups lots of services together to save memory. In both cases, killing one svchost can stop several services at once.
The registry is Windows’ settings database. HKEY_LOCAL_MACHINE (HKLM) holds the machine’s settings and HKEY_CURRENT_USER holds the signed-in user’s. Each service has a key under HKLM\SYSTEM\CurrentControlSet\Services, where Start is the start type (2 Automatic, 3 Manual, 4 Disabled), ImagePath is the program and ObjectName is the account.
Event logs are files kept in C:\Windows\System32\winevt\Logs, covering System, Application, Security, Setup and hundreds of role-specific logs, and you read them with Event Viewer or Get-WinEvent.
How it works, step by step
This is what happens between pressing the power button and seeing the sign-in screen. If a server won’t boot, the step where it stops tells you what’s broken:
- Firmware (BIOS or UEFI) tests the hardware and finds the boot disk.
- Windows Boot Manager reads the Boot Configuration Data (BCD), the list of Windows installations and their settings, which you’ll look at with
bcdeditin the lab. - winload loads the kernel (
ntoskrnl.exe), the boot-start drivers and the SYSTEM registry hive. - The kernel starts the Session Manager (
smss.exe), which startswininit.exefor session 0. - wininit starts
services.exe, which starts every Automatic service in dependency order, andlsass.exe, which handles security. - winlogon shows the sign-in screen, and the System log records the start as event 12 (Kernel-General) and 6005 (EventLog service started).
These are the accounts services run as, from the most powerful down to the least:
Give a service the weakest account that still lets it do its job. If a service running as LocalSystem gets compromised the attacker owns the whole server, but the same service running as LocalService could do far less damage.
Hands-on Lab: explore Windows internals on DC01
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
Start DC01, sign in and open PowerShell as administrator. Up until the Break It section, everything here only reads.
1See which processes run in session 0
Run this:
Get-Process -Name lsass, services, wininit, explorer | Select-Object Name, Id, SessionIdYou should see something like this:
Name Id SessionId
---- -- ---------
explorer 4812 1
lsass 712 0
services 696 0
wininit 584 0explorer is your desktop, so it sits in your session (1), while the system processes run in session 0, where nobody signs in. That’s the reason a service can never pop up a window on your desktop.
✅ Checkpoint: lsass, services and wininit show SessionId 0; explorer shows your session number.
2Read a service’s account, path and start mode
Run this:
Get-CimInstance Win32_Service -Filter "Name='Spooler' OR Name='Dnscache' OR Name='W32Time'" |
Select-Object Name, StartMode, State, StartName, ProcessIdYou should see something like this:
Name StartMode State StartName ProcessId
---- --------- ----- --------- ---------
Dnscache Auto Running NT AUTHORITY\NetworkService 1544
Spooler Auto Running LocalSystem 2716
W32Time Auto Running NT AUTHORITY\LocalService 1208
Get-Service doesn’t show the account, but Win32_Service does, in StartName, and you can see the three services use three different accounts. The print spooler runs as LocalSystem, which is why spooler bugs have been among the most serious Windows security holes.
✅ Checkpoint: You can see the account each service runs as.
3Find which services share a svchost
Run this:
Get-CimInstance Win32_Service -Filter "State='Running'" |
Where-Object PathName -like '*svchost*' |
Group-Object ProcessId |
Where-Object Count -gt 1 |
Select-Object Name, Count, @{n='Services';e={$_.Group.Name -join ', '}} -First 3You should see something like this:
Name Count Services
---- ----- --------
1052 3 BFE, mpssvc, PolicyAgent
1404 3 Dnscache, LanmanWorkstation, NlaSvc
2208 2 CryptSvc, WinRMEach line is one svchost process (by PID) hosting several services, and if you kill that process every service on the list stops with it. Keep that in mind the next time someone says “just end the svchost that’s using CPU”.
✅ Checkpoint: You found at least one svchost hosting more than one service.
4Check service dependencies
Run these one at a time:
Get-Service -Name LanmanWorkstation -DependentServices | Select-Object Name, Status
Get-Service -Name Netlogon -RequiredServices | Select-Object Name, StatusYou should see something like this:
Name Status
---- ------
SessionEnv Running
Netlogon Stopped
Name Status
---- ------
LanmanWorkstation RunningDependentServices are the services that rely on this one, so stopping it stops them as well.
RequiredServices are the ones it relies on. Netlogon, which keeps a computer’s trust with the domain, depends on the Workstation service, and it’s stopped for now because DC01 isn’t in a domain yet (that changes in Lesson 11).
✅ Checkpoint: You can name a service that depends on LanmanWorkstation.
5Find the same settings in the registry
Run this:
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Services\Spooler | Select-Object Start, ImagePath, ObjectName, DependOnServiceYou should see something like this:
Start ImagePath ObjectName DependOnService
----- --------- ---------- ---------------
2 %SystemRoot%\System32\spoolsv.exe LocalSystem {RPCSS, http}HKLM: is a PowerShell drive for the registry, so you can browse it like a folder. Start 2 means Automatic (3 is Manual, 4 Disabled). Everything services.msc shows you comes from this key, so you can still check or fix a service on a server where the console won’t open.
✅ Checkpoint: The registry shows Start 2 and ImagePath spoolsv.exe for the Spooler.
6Read the boot configuration and boot events
Run these one at a time:
bcdedit /enum '{current}'
Get-WinEvent -FilterHashtable @{LogName='System'; Id=12,13,6005,6006} -MaxEvents 4 | Select-Object TimeCreated, Id, ProviderNameYou should see something like this:
Windows Boot Loader
-------------------
identifier {current}
device partition=C:
path \Windows\system32\winload.exe
description Windows Server
locale en-US
recoverysequence {8a1f3e52-6c0b-11f0-9a4e-c2e4a1b7d3f0}
displaymessageoverride Recovery
recoveryenabled Yes
osdevice partition=C:
systemroot \Windows
nx OptOut
TimeCreated Id ProviderName
----------- -- ------------
19-10-2026 19:05:12 6005 EventLog
19-10-2026 19:05:04 12 Microsoft-Windows-Kernel-General
19-10-2026 19:04:40 6006 EventLog
19-10-2026 19:04:39 13 Microsoft-Windows-Kernel-GeneralThe BCD entry tells Boot Manager which loader to run (winload.exe here, winload.efi on UEFI) and where Windows lives. In the events, 13 and 6006 mark the last shutdown and 12 and 6005 the next start, and the gap between them is how long the server was down, which is a quick way to confirm “it restarted at 19:04”.
✅ Checkpoint: You can see the winload path in the BCD and a 13/12 pair for the last restart.
7Find the event log files
Run this:
Get-ChildItem C:\Windows\System32\winevt\Logs -Filter *.evtx |
Sort-Object Length -Descending |
Select-Object -First 5 Name, @{n='MB';e={[math]::Round($_.Length/1MB,1)}}You should see something like this:
Name MB
---- --
Security.evtx 20.1
System.evtx 4.1
Application.evtx 2.1
Microsoft-Windows-PowerShell%4Operational.evtx 15.1
Windows PowerShell.evtx 1.1Every log here is a .evtx file with a maximum size, and once it’s full the oldest events get overwritten, so on a busy server the Security log might only cover a few days. Lesson 43 shows you how to keep logs for longer.
✅ Checkpoint: You can see the Security, System and Application log files and their sizes.
Break It, Then Fix It
Most “it stopped working” tickets start with a service. You’ll break two of them on DC01 in safe ways and then fix them.
1Break it: stop a service that others depend on
Run this:
Stop-Service -Name LanmanWorkstationYou’ll get an error like this:
Stop-Service : Cannot stop service 'Workstation (LanmanWorkstation)' because it has dependent services. It can only be
stopped if the Force flag is set.
At line:1 char:1
+ Stop-Service -Name LanmanWorkstation
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.ServiceProcess.ServiceController:ServiceController) [Stop-Service],
ServiceCommandException
+ FullyQualifiedErrorId : ServiceHasDependentServices,Microsoft.PowerShell.Commands.StopServiceCommand
This error is PowerShell protecting you. -Force would stop Workstation along with every service that depends on it, and on a domain controller that includes Netlogon, the service computers need to authenticate.
Fix it: leave -Force alone. Check what would stop with Get-Service LanmanWorkstation -DependentServices first and think about whether you need to stop the parent at all, because usually you only need to restart the one service that’s misbehaving.
✅ Checkpoint: You saw the dependent-services error, and Workstation is still running.
2Break it: a disabled service that won’t start
Disable the print spooler and then try to start it:
Stop-Service -Name Spooler
Set-Service -Name Spooler -StartupType Disabled
Start-Service -Name SpoolerYou’ll get an error like this:
Start-Service : Service 'Print Spooler (Spooler)' cannot be started due to the following error: Cannot start service
Spooler on computer '.'.
At line:1 char:1
+ Start-Service -Name Spooler
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
ServiceCommandException
+ FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommandNotice the message never says “disabled”, and that’s why this one catches people out. Check the start type, either in PowerShell or straight from the registry:
Run these:
Get-Service -Name Spooler | Select-Object Name, Status, StartType
(Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Services\Spooler).StartYou should see this:
Name Status StartType
---- ------ ---------
Spooler Stopped Disabled
4To fix it, set it back to Automatic and start it:
Set-Service -Name Spooler -StartupType Automatic
Start-Service -Name Spooler
Get-Service -Name Spooler | Select-Object Name, Status, StartTypeYou should see this:
Name Status StartType
---- ------ ---------
Spooler Running AutomaticThe System log recorded the attempt too, as event 7000 from Service Control Manager: “The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.” When a service won’t start, the System log usually explains why better than the command does.
✅ Checkpoint: The Spooler is Running and Automatic again, and you found event 7000 in the System log.
This happened at work
The svchost that took the file shares with it
On a busy file server, users started complaining that things were slow. The admin opened Task Manager, spotted one svchost.exe at 40% CPU and ended the process. The CPU dropped, and so did every file share on the server, and 300 people lost their mapped drives in the middle of the afternoon.
It turned out that svchost was hosting several services together, including the Server service (LanmanServer) that provides file sharing, and the CPU was really being eaten by a Windows Update scan running in the same process.
Windows brought some services back by itself, but the shares took ten minutes to return and several users lost documents they had open.
The fix: the team’s runbook now says that before ending any svchost you find the services inside it (Get-CimInstance Win32_Service -Filter "ProcessId=1234", or the Details and Services tabs in Task Manager) and restart only the guilty one. The file servers also got more memory, so most services now run in their own svchost.
The lesson: on Windows a process name tells you very little, so find out what’s inside it before you kill it.
Common mistakes and troubleshooting
| Mistake or symptom | What happens | What to do instead |
|---|---|---|
| Ending a svchost.exe that uses CPU | Every service inside it stops | Find the services in that PID first; restart only the one at fault |
| Using Stop-Service -Force without checking | Dependent services stop too | Check -DependentServices first |
| “Cannot start service … on computer ‘.'” | The message hides the real reason | Check StartType and the System log (event 7000 and 7001) |
| Running services as LocalSystem by habit | A compromised service owns the whole server | Use the least powerful account; managed service accounts for apps |
| Editing the registry without a backup | A typo can stop a service or Windows from starting | Export the key first (reg export), or change it with Set-Service |
| Assuming the GUI is the only source of truth | You get stuck when consoles won’t open | Read Win32_Service and the Services registry key directly |
| Ignoring Session 0 | Expecting a service to show a window | Services never interact with the desktop; check their logs instead |
| Security log covers only a few days | Old evidence is overwritten | Raise the log size (Lesson 43) or forward events (Lesson 39) |
| “The service did not respond to the start or control request in a timely fashion” (7009) | The service hangs at start | Check dependencies, disk and network it needs; look at its own log |
Interview questions
Click a question to open it. Each one is written the way an interviewer would ask it. Under it you will see why they ask it and one way you could answer, in your own words.
Fresher level
1. Can you explain in simple words the difference between a process and a service?
Why they ask this: You’ll deal with both every day as an admin, so they want to know you understand how Windows runs programs.
How you might answer: A process is any program that’s running. A service is a program the Service Control Manager starts, and it runs in the background with nobody signed in.
A service also comes with a start type, an account it runs as and recovery settings.
2. When you set up a service, which built-in accounts could it run as, and how are they different?
Why they ask this: The account decides what the service can touch, both locally and on the network, so they want to see you know the built-in identities.
How you might answer: LocalSystem has full power on the local machine. LocalService has minimal rights and is anonymous on the network, and NetworkService has minimal local rights but uses the computer account on the network.
It can also run as a domain account or a managed service account.
3. The Services console won’t open on a server. Where else could you look to see a service’s settings?
Why they ask this: The registry holds the real settings behind every service, and they want to see you know where to go when the GUI lets you down.
How you might answer: I’d go to the registry under HKLM\SYSTEM\CurrentControlSet\Services\<name>, where I can see values like Start, ImagePath, ObjectName and DependOnService.
2–5 years experience
4. An app team says their service won’t start after a reboot. Walk me through how you’d troubleshoot it.
Why they ask this: They want a method rather than retry-and-hope, and they want to hear that you’d fix the cause and not only the symptom.
How you might answer: I’d check the StartType first in case it’s disabled, then the System log for events 7000, 7001, 7009 or 7038. After that I’d look at its dependencies with -RequiredServices, the account and its password, and the service’s own log.
Then I’d fix whatever the real cause is, rather than just trying to start it again.
5. You see svchost.exe using a lot of CPU, and a colleague wants to end it in Task Manager. What would you tell them?
Why they ask this: Killing the wrong shared service process can stop several services at once, and they want to know you understand that.
How you might answer: I’d ask them to hold on. svchost.exe hosts services written as DLLs, and several of them can share one svchost, especially on servers with less memory.
Ending it stops every one of them, so I’d first look up which services are inside it by PID.
6. A server is stuck during startup. Walk me through the Windows boot process so we can work out where it’s failing.
Why they ask this: If you know the order of the steps, you know which part to fix, so they want to see you reason about where boot fails.
How you might answer: First the firmware, then Boot Manager reads the BCD and winload loads the kernel and boot drivers. The kernel starts smss, wininit then starts services and lsass, and finally winlogon shows the sign-in screen.
The step where it stops tells me what to fix.
Senior level
7. A vendor wants their new service to run as a Domain Admin account. How would you decide which account it should really use?
Why they ask this: Over-privileged service accounts are a favourite target for attackers, and they want to see you hold to least privilege even when a vendor pushes.
How you might answer: I’d start from what the service needs, whether that’s local access only, network access as the machine, or an identity of its own. I’d rather use a virtual or group managed service account than a named user account.
After that I’d grant only the rights it needs and write them down.
8. A service runs fine for days and then stops. How would you make it restart itself, and when would that be a bad idea?
Why they ask this: Auto-restart can hide a real problem until it grows into a bigger one, so they want to see you know the recovery options and the risk.
How you might answer: I’d set recovery actions with sc.exe failure or the Recovery tab, something like restart after 1 minute and reset the count after a day, and send an alert on every restart.
It’s a bad idea when the restarts are hiding a real fault or could damage data, and then it should fail loudly and page someone.
9. Why did Microsoft split services into separate svchost processes? What did they gain, and what did it cost?
Why they ask this: Senior engineers are expected to explain why a system was built the way it was, not only recite facts.
How you might answer: They got isolation and reliability, because one crashing service doesn’t take others down any more, and it’s easier to see each service’s CPU and memory.
The price is more memory, which is why Windows still groups them on low-memory systems.
Quick quiz
Q1. Which session do system services run in?
- Session 0
- Session 1
- The admin’s session
Show answer
A — System processes and services run in session 0, which nobody signs in to.
Q2. What does Start = 4 mean in a service’s registry key?
- Automatic
- Manual
- Disabled
Show answer
C — 2 Automatic, 3 Manual, 4 Disabled.
Q3. Why did Stop-Service LanmanWorkstation fail?
- Wrong name
- It has dependent services
- Access denied
Show answer
B — Without -Force, PowerShell won’t stop a service others depend on.
Q4. Which event IDs mark a shutdown and a start in the System log?
- 13 and 12
- 4624 and 4625
- 7000 and 7009
Show answer
A — 13 is shutdown, 12 is start (Kernel-General); 6006 and 6005 come from EventLog.
Q5. In the work story, what went wrong?
- A disk failed
- Ending a shared svchost stopped the file sharing service too
- The server ran out of licences
Show answer
B — Find the services inside a svchost before ending it.
Quick recap
- Windows internals for admins covers processes, services, accounts, the registry, boot and logs.
- System processes run in session 0, and services are started by
services.exe. - Read a service’s account with
Win32_Service(StartName); its settings live underHKLM\SYSTEM\CurrentControlSet\Services. - svchost can host several services, so find them by PID before you end one.
- Boot: firmware, Boot Manager and BCD, winload, kernel, smss, wininit, services and lsass, winlogon.
- Event logs are .evtx files in
winevt\Logs; the System log explains failed services (7000, 7009).
Next lesson
Lesson 9: Windows Server networking basics → You’ll cover IP addressing and subnets, how Windows decides which DNS server to ask and in what order, firewall profiles and rules, and NIC teaming with Switch Embedded Teaming.
Further reading: Windows internals
If you want more on Windows internals, Microsoft’s Windows Internals book page on Microsoft Learn points you to the classic book on the subject, and the free Sysinternals tools (Lesson 52) let you watch it all live. The full plan for this course is on the Windows Server Administration course page.
