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 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.
# 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 LAPSConfigure 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.
# 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-LapsPasswordControl 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:
alicefor email and browsing,adm-alicefor administration. Never browse or read email asadm-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.
Add-ADGroupMember -Identity "Protected Users" -Members adm-alice
Get-LocalGroupMember -Group Administrators # audit who is a local adminReplace 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.
# 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-webThen 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
net accounts /lockoutthreshold:10 /lockoutduration:15 /lockoutwindow:15
net accounts /minpwlen:14Use 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.
- No internet exposure. Reach it through a VPN, an RD Gateway, or a bastion with MFA.
- Require Network Level Authentication (NLA) so authentication happens before a session is created:
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name UserAuthentication -Value 1- Scope the firewall to your admin range:
Get-NetFirewallRule -DisplayGroup "Remote Desktop" | Set-NetFirewallRule -RemoteAddress 203.0.113.0/24
Get-NetFirewallRule -DisplayGroup "Remote Desktop" | Get-NetFirewallAddressFilter # verify- Limit who may log in: only a named group in Remote Desktop Users, and Allow log on through Remote Desktop Services restricted to it.
- 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.
- 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
- In a domain lab, run the LAPS preparation, apply the policy, and retrieve a test server's password.
- Create
adm-yourname, add it to Protected Users, and confirm you can still administer a test server. - Create a gMSA and run a test service as it.
- Enable NLA, scope the RDP firewall rule to one address, and confirm a connection from another address is refused.
Checkpoint
- What problem does LAPS solve, and where are the passwords stored?
- Why must an admin have separate admin and daily-use accounts?
- What is a gMSA and why is it safer than a shared service account?
- Name four controls for a safe RDP setup.
- Which event ID shows a successful RDP logon, and what do you check in it?