Lesson 8 of 12 · 18 min · Intermediate

Windows Server: accounts, LAPS, admin tiering and RDP

Give every server a unique local admin password with Windows LAPS, separate admin and daily accounts, use Protected Users and gMSAs, and lock RDP down: NLA, scoped firewall, gateway or VPN, session limits and the right audit events.

In this lesson you will

  • Deploy Windows LAPS and retrieve a password safely
  • Apply a basic admin tiering model and Protected Users
  • Replace shared service accounts with gMSAs
  • Lock down RDP and know the events that show abuse

On Windows, stolen credentials are the main attack path. An attacker who gets one admin password and finds it works on every server moves through the network in minutes. This lesson makes sure one stolen credential does not unlock the next machine.

Windows admin access: who can reach what

Windows LAPS: a unique local admin password everywhere

When every server shares the same built-in Administrator password, one compromise is all of them. Windows LAPS (built into current Windows Server) gives each machine its own random local-admin password, stores it in Active Directory (or Entra ID), and rotates it.

powershell
# On a domain controller or admin host (one-time AD preparation)
Update-LapsADSchema
Set-LapsADComputerSelfPermission -Identity "OU=Servers,DC=corp,DC=example"

# Check the LAPS module is present on the server
Get-Command -Module LAPS

Configure the policy with Group Policy: Computer Configuration, Administrative Templates, System, LAPS. Set the password length (14 or more), age (for example 30 days), the backup directory (Active Directory), and the account to manage.

powershell
# Retrieve a password when you genuinely need break-glass access
Get-LapsADPassword -Identity SERVER01 -AsPlainText

# Rotate it immediately after use (run on the server)
Reset-LapsPassword

Control who can read the passwords with AD permissions, and audit those reads. Every retrieval should have a reason.

Separate admin and daily accounts: tiering in practice

The classic rule: an account that logs on to a low-trust machine must never be the one that administers a high-trust one, because credentials left on the low-trust machine get stolen.

Tier What it covers Rule
Tier 0 Domain controllers, identity, PKI Only Tier 0 admin accounts, only from hardened workstations
Tier 1 Servers and applications Server admin accounts; never used on workstations
Tier 2 User workstations Help-desk accounts; no server rights

Practical steps:

  • Give every admin two accounts: alice for email and browsing, adm-alice for administration. Never browse or read email as adm-alice.
  • Use Privileged Access Workstations for Tier 0/1 admin work: clean, hardened machines that do nothing else.
  • Add admin accounts to the Protected Users group (it blocks NTLM, weak Kerberos and credential caching for them). Do not add service or computer accounts, and test first because it breaks some delegation.
  • Use Group Policy to deny logon rights for higher tiers on lower-tier machines: Deny log on locally, Deny log on through Remote Desktop Services, Deny access to this computer from the network.
powershell
Add-ADGroupMember -Identity "Protected Users" -Members adm-alice
Get-LocalGroupMember -Group Administrators        # audit who is a local admin

Replace shared service accounts with gMSAs

A service account with a static password that never changes is a stealable asset. Group Managed Service Accounts have long random passwords rotated automatically by AD.

powershell
# One-time per forest: create the KDS root key (lab shortcut shown; in production let it replicate)
Add-KdsRootKey -EffectiveTime ((Get-Date).AddHours(-10))

New-ADServiceAccount -Name svc-web -DNSHostName svc-web.corp.example -PrincipalsAllowedToRetrieveManagedPassword "WebServers"

# On the server that will run the service
Install-ADServiceAccount svc-web
Test-ADServiceAccount svc-web

Then set the service to log on as CORP\svc-web$ with a blank password. If a product cannot use a gMSA, give it its own account with a long random password stored in your secrets vault and an owner.

Account and password policy

powershell
net accounts /lockoutthreshold:10 /lockoutduration:15 /lockoutwindow:15
net accounts /minpwlen:14

Use these as local settings for standalone servers; in a domain, set them with the Default Domain Policy or fine-grained password policies. Modern guidance (NIST SP 800-63B) favours long passphrases, a banned-password list, and no forced periodic rotation unless there is evidence of compromise. In Entra ID, enable Password Protection.

Lock down RDP

RDP is the most attacked Windows service on the internet. The rule is simple: never expose it directly.

  1. No internet exposure. Reach it through a VPN, an RD Gateway, or a bastion with MFA.
  2. Require Network Level Authentication (NLA) so authentication happens before a session is created:
powershell
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name UserAuthentication -Value 1
  1. Scope the firewall to your admin range:
powershell
Get-NetFirewallRule -DisplayGroup "Remote Desktop" | Set-NetFirewallRule -RemoteAddress 203.0.113.0/24
Get-NetFirewallRule -DisplayGroup "Remote Desktop" | Get-NetFirewallAddressFilter   # verify
  1. Limit who may log in: only a named group in Remote Desktop Users, and Allow log on through Remote Desktop Services restricted to it.
  2. Session hygiene (Group Policy): Computer Configuration, Administrative Templates, Windows Components, Remote Desktop Services, Remote Desktop Session Host. Set Security: Require use of specific security layer (SSL), Set client connection encryption level: High, Always prompt for password upon connection, and Session Time Limits for idle and disconnected sessions. Disable clipboard and drive redirection on servers that do not need it.
  3. Use Remote Credential Guard or Restricted Admin so the admin's credentials are not left on the target: mstsc /remoteGuard.

Back-out for RDP changes: work from the console. If NLA breaks an old client, fix the client rather than disabling NLA.

The events that show RDP abuse

Event Log Meaning
4624, logon type 10 Security Successful RDP logon (check source address)
4625 Security Failed logon (a burst means guessing)
1149 TerminalServices-RemoteConnectionManager RDP authentication succeeded
4672 Security Special privileges assigned (admin logon)
4740 Security Account locked out

🧪 Lab

  1. In a domain lab, run the LAPS preparation, apply the policy, and retrieve a test server's password.
  2. Create adm-yourname, add it to Protected Users, and confirm you can still administer a test server.
  3. Create a gMSA and run a test service as it.
  4. Enable NLA, scope the RDP firewall rule to one address, and confirm a connection from another address is refused.

Checkpoint

  1. What problem does LAPS solve, and where are the passwords stored?
  2. Why must an admin have separate admin and daily-use accounts?
  3. What is a gMSA and why is it safer than a shared service account?
  4. Name four controls for a safe RDP setup.
  5. Which event ID shows a successful RDP logon, and what do you check in it?