If you run Windows Servers, you already know the drill: a new vulnerability drops, someone forwards you a scary headline, and you spend the afternoon figuring out whether it actually applies to you. The last couple of years have given us plenty of those afternoons. A new Active Directory privilege escalation path (BadSuccessor) showed up in a feature that only exists in Windows Server 2025. A WSUS remote code execution bug got an emergency out-of-band patch and was being exploited within hours. And Microsoft keeps shipping Patch Tuesday releases big enough that “just patch everything” stops being a plan and becomes a project.
This guide is what I’d hand to another sysadmin who asked, “OK, but what do I actually do to harden Windows Server 2022 and 2025?” It covers both on-prem servers (domain-joined and standalone) and servers running in Azure. Every step has either a setting you can look up, a PowerShell command you can run, or an event ID you can watch for. Where something can break production, I’ll say so, because nothing makes a security project die faster than an unannounced outage.
One ground rule before we start: test everything in a lab or on a non-critical server first, and use audit modes wherever they exist. Most of the pain in hardening comes from enforcing something before you know what depends on the old behavior.
What Windows Server 2025 gives you for free (and what it doesn’t)
Windows Server 2025 raised the default security bar quite a bit compared to 2022. But “better defaults” is not the same as “hardened,” and a lot of those defaults depend on hardware, domain membership, or whether the server is brand new versus upgraded. Here’s the short version:
| Area | Windows Server 2022 | Windows Server 2025 |
|---|---|---|
| Credential Guard | Off unless you enable it | On by default when the server meets hardware and licensing requirements, is domain joined, isn’t a domain controller, and hasn’t been explicitly configured otherwise |
| SMB signing | Not required by default | Outbound (client-side) signing required by default |
| LDAP signing on DCs | Optional; unsigned binds accepted | Required by default on new AD deployments; channel binding set to “When supported” |
| NTLMv1 | Still present | Removed (NTLMv2 still works unless you restrict it) |
| Windows LAPS | Available with updates | Built in |
| OSConfig baselines with drift control | Not available | Available (2025 only) |
| Delegated managed service accounts (dMSA) | Not available | Available, and it comes with a security caveat we’ll cover below |
The practical takeaway: if you’re on 2025, verify these protections are actually active on your servers rather than assuming. If you’re on 2022, you have to turn most of them on yourself. Either way, the rest of this post applies, and I’ll flag the 2025-only items as we go.
Step 1: Patch like you mean it
It’s boring advice, but it’s still where most compromises start. Two habits make the difference.
Know what’s actually exploited, not just what’s “Critical”
Microsoft’s severity ratings and real-world exploitation don’t always line up. A “Moderate” bug that’s being exploited matters more to you this week than a “Critical” one that needs a rare configuration. Each month, after Patch Tuesday, check the CISA Known Exploited Vulnerabilities catalog and the Microsoft Security Update Guide and patch anything marked exploited first. Network-facing services on servers (LDAP, DNS, DHCP, Schannel/TLS, SMB, RPC) deserve extra attention in any given month’s release, because they’re what attackers can reach without a login.
The WSUS lesson
In October 2025, CVE-2025-59287, a critical unauthenticated remote code execution flaw in WSUS, got an emergency out-of-band fix after proof-of-concept code went public. The CISA alert and several vendors reported exploitation shortly after, mostly against WSUS servers exposed on TCP 8530 and 8531. If you want the technical details, the researchers at Hawktrace published their analysis, and CISA’s bulletin has the mitigation steps.
What to do on your side:
- Check whether you even have the role:
Get-WindowsFeature UpdateServices. It’s not installed by default, so if it says “Available” and not “Installed,” you’re fine for this one. - If you do run WSUS, make sure it’s fully patched and reboot it afterward. Then make sure 8530/8531 aren’t reachable from the internet or from networks that have no business talking to it.
- Treat patch infrastructure as tier-0-adjacent. Whoever controls your update server can push code to your fleet.
Check your patch level fast
# Last 10 installed updates on a server
Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 10
# Same check across many servers (needs WinRM)
Invoke-Command -ComputerName (Get-Content .\servers.txt) -ScriptBlock {
Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 1
} | Select-Object PSComputerName, HotFixID, InstalledOn
For Windows Server 2025 machines connected through Azure Arc, look into hotpatching so you can cut down on reboot windows. Fewer reboots means patches actually get approved faster.
Step 2: Shrink the attack surface
Every role, feature, and service you don’t need is something that can be exploited. This is the cheapest hardening you’ll ever do.
Use Server Core where you can
Server Core has fewer components, fewer patches that apply to it, and no desktop for someone to RDP into and poke around. Plan this at build time: Microsoft’s own hardening write-up points out that on Windows Server 2025 you can’t convert between Server Core and Desktop Experience after installation, so changing your mind later means a clean install. Read the ITOps Talk hardening post for the full list of tools they recommend.
Audit installed roles and features
# What's installed?
Get-WindowsFeature | Where-Object Installed
# Remove something you don't need
Uninstall-WindowsFeature -Name Telnet-Client
Turn off the things that keep showing up in advisories
# Print Spooler: disable on domain controllers and any server that doesn't print
Stop-Service -Name Spooler -Force
Set-Service -Name Spooler -StartupType Disabled
# SMBv1: confirm it's off
Get-SmbServerConfiguration | Select-Object EnableSMB1Protocol
Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force
The Print Spooler has been a repeat offender for years. Unless a server is genuinely a print server, there’s no reason for it to be running.
Lock down the host firewall
# Make sure all three profiles are on and default-deny inbound
Set-NetFirewallProfile -Profile Domain,Private,Public -Enabled True -DefaultInboundAction Block
# See which inbound allow rules are active
Get-NetFirewallRule -Direction Inbound -Enabled True -Action Allow |
Select-Object DisplayName, Profile | Sort-Object DisplayName
Do not do this blind on a production server. Pull the list of active inbound rules first, compare it against what the server actually needs to do, and change one profile at a time.
Step 3: Start from a baseline instead of inventing your own
This is where I see people burn the most time. You do not need to hand-pick 400 settings. Three sources already did it for you:
- Microsoft Security Baselines. Microsoft publishes a Windows Server 2025 baseline split into Domain Controller, Member Server, and Workgroup Member. A February 2026 release (version 2602) is the most recent one I found while writing this; check the Microsoft Security Baselines blog for anything newer.
- CIS Benchmarks. Level 1 is the “do this everywhere” profile. Level 2 is stricter and more likely to break things.
- DISA STIGs. Required if you’re in or near government work, and a useful reference even if you aren’t. For example, the 2025 STIG calls for the LAN Manager authentication level to be set to send NTLMv2 responses only and refuse LM and NTLM.
OSConfig on Windows Server 2025
If you’re on 2025, look at OSConfig. It applies Microsoft’s role-specific baselines as named scenarios, and, the part I like most, it detects drift and puts the approved settings back if someone changes them. The scenarios are named like this:
SecurityBaseline/WindowsServer/2025/MemberServer
SecurityBaseline/WindowsServer/2025/DomainController
SecurityBaseline/WindowsServer/2025/WorkgroupMember
It ships as the Microsoft.OSConfig PowerShell module and can also be driven through Windows Admin Center, Azure Arc, and Azure Policy machine configuration. That last one matters for hybrid shops: you get continuous enforcement and reporting without depending on Group Policy reaching the server. Check the current Windows Server documentation on Microsoft Learn for the exact cmdlet syntax before you run it, since this tooling has been moving quickly.
For 2022 and 2019, apply the baseline through Group Policy using the Microsoft Security Compliance Toolkit, or use CIS-CAT to assess where you stand. Either way: import it into a test OU, link it to one non-critical server, and watch the event logs for a week before you widen it.
Step 4: Protect identities, because that’s what attackers are really after
Most modern server compromises aren’t about the server. They’re about stealing a credential on one server and using it everywhere else. This is the section that does the most to limit blast radius.
Deploy Windows LAPS to every server
Shared local administrator passwords are still one of the most common lateral movement paths in Windows networks. Windows LAPS (the built-in one, not the legacy MSI) fixes that by giving each machine its own random, rotated password. The basic AD setup, straight from Microsoft’s LAPS documentation:
# One-time, forest-wide schema update (run from a DC with Windows LAPS installed, or any server with the module)
Update-LapsADSchema
# Grant computers the right to update their own password attributes on an OU
Set-LapsADComputerSelfPermission -Identity "OU=Servers,DC=corp,DC=example,DC=com"
# Group Policy: set Configure password backup directory = Active Directory (value 2)
# Optional but recommended: turn on password encryption (needs domain functional level 2016 or higher)
# Force a policy cycle on a server and then verify
Invoke-LapsPolicyProcessing
# Retrieve a password
Get-LapsADPassword -Identity SERVER01 -AsPlainText
Confirm it worked by looking for event ID 10018 in the Windows LAPS operational log on the server. And be careful about who gets read permission on those attributes. Anyone with the extended right to read confidential attributes can read every LAPS password in that OU, which defeats the point.
Check that Credential Guard is actually running
On 2025 it’s on by default under the conditions in the table above, but “on by default” and “running on your hardware” aren’t the same thing. Check it:
Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard |
Select-Object -ExpandProperty SecurityServicesRunning
# A value of 1 in the output means Credential Guard is running
On 2022 you’ll need to enable it through Group Policy (Computer Configuration, Administrative Templates, System, Device Guard, Turn On Virtualization Based Security) and it requires UEFI, Secure Boot, and a CPU with virtualization extensions. In Azure, make sure the VM size and security type support it. Also, expect some friction: Credential Guard breaks unconstrained Kerberos delegation and anything that relied on NTLMv1-derived credentials. Test your legacy apps first, and resist the temptation to turn it off on production to make an old plugin happy. A good write-up on what 2025’s defaults break goes through that tradeoff in detail.
Admin accounts: tier them, protect them
- Use separate accounts for daily work and for server administration. Domain Admins should never log into a member server interactively.
- Put human admin accounts in the Protected Users group. Never put service accounts or computer accounts in it, because they’ll stop authenticating.
Add-ADGroupMember -Identity "Protected Users" -Members "adm-jsmith","adm-mlopez" - For RDP admin sessions, use Restricted Admin (
mstsc /restrictedAdmin) or Remote Credential Guard (mstsc /remoteGuard) so reusable credentials aren’t left on the target server. - Use a dedicated privileged access workstation if you can. If you can’t, at least don’t browse the web from the same machine you use to manage domain controllers.
BadSuccessor: the 2025 domain controller issue you should check for
Windows Server 2025 introduced delegated Managed Service Accounts (dMSAs) to make migrating away from old service accounts easier. In 2025, Akamai researcher Yuval Gordon showed how dMSA migration could be abused for privilege escalation. The part that made admins sit up: the weakness existed in any domain with even one Windows Server 2025 domain controller, whether or not you used dMSAs at all.
Microsoft has since patched it (tracked as CVE-2025-53779), and Akamai followed up with an analysis of how the patch changed things. But patching is only the first step. What to do:
- Make sure every Windows Server 2025 domain controller has the fix installed.
- Review who has permission to create child objects in your OUs. The attack needed very little, and in Akamai’s testing most environments had non-admin accounts with enough rights.
- Look for dMSA objects you didn’t create:
Get-ADObject -LDAPFilter "(objectClass=msDS-DelegatedManagedServiceAccount)" ` -Properties msDS-ManagedAccountPrecededByLink, whenCreated | Select-Object Name, whenCreated, msDS-ManagedAccountPrecededByLink - Turn on Directory Service Changes auditing and alert on creation of dMSA objects and changes to the link attribute above. The detection guidance in the Akamai post and in Semperis’ write-up is worth reading before you build your alert.
Microsoft’s own December 2025 guidance on mitigating critical threats to Active Directory Domain Services is a good companion read. It lists deprecating NTLM, enforcing SMB signing and LDAP channel binding, moving off RC4 for Kerberos, cleaning up unused SPNs, and applying the 2025 OSConfig baselines to domain controllers.
Step 5: Clean up legacy protocols (NTLM, SMB, LDAP, Kerberos)
This is the step where outages happen, so the pattern is always the same: audit, read the logs, fix what’s talking the old way, then enforce.
NTLM
Windows Server 2025 removed NTLMv1 but didn’t switch NTLM off; NTLMv2 still works unless you restrict it. In one lab test, a fully patched 2025 server still accepted an NTLMv1 logon from a Linux client until a policy changed, which is a good reminder to test rather than assume. Microsoft’s plan is to disable network NTLM by default in a future Windows Server release, so the work you do now is not wasted.
Start with auditing. Under Computer Configuration, Windows Settings, Security Settings, Local Policies, Security Options, configure:
- Network security: Restrict NTLM: Audit NTLM authentication in this domain = Enable all
- Network security: Restrict NTLM: Audit Incoming NTLM Traffic = Enable auditing for all accounts
- Network security: Restrict NTLM: Outgoing NTLM traffic to remote servers = Audit all
Then watch the NTLM operational log. Events 8001 through 8004 tell you who is still using NTLM, and on domain controllers, event 4776 is a quick way to baseline NTLM volume. Give it a few weeks, build an exception list, and only then start denying.
SMB signing and encryption
# What's the current state?
Get-SmbServerConfiguration | Format-List RequireSecuritySignature
Get-SmbClientConfiguration | Format-List RequireSecuritySignature
# Audit for devices that can't sign or encrypt before you require it
Set-SmbServerConfiguration -AuditClientDoesNotSupportSigning $true
Set-SmbServerConfiguration -AuditClientDoesNotSupportEncryption $true
# Require signing on the server side
Set-SmbServerConfiguration -RequireSecuritySignature $true -Force
# Encrypt a specific share
Set-SmbShare -Name "Finance" -EncryptData $true
The usual casualties are old NAS appliances, scanners, and third-party Samba setups. Requiring signing also disables guest access to shares. Microsoft’s SMB signing documentation lists the exact error messages you’ll see when a device doesn’t cooperate (including STATUS_INVALID_SIGNATURE), which is handy when your help desk gets the first call.
LDAP signing and channel binding on domain controllers
On Windows Server 2025, new AD deployments require LDAP signing by default and channel binding is set to “When supported.” That doesn’t change anything for existing domains you’ve upgraded in place, so check your actual settings. Watch the Directory Service log on your DCs:
- 2886 on startup warns that unsigned LDAP binds are allowed.
- 2887 summarizes unsigned binds over a 24-hour period.
- 2889 names the client IP and account making an unsigned bind (this needs diagnostics logging turned on).
- 3039, 3040 and 3041 do the same job for channel binding tokens.
# Turn on the diagnostics that populate 2889 and 3039
reg add HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics /v "16 LDAP Interface Events" /t REG_DWORD /d 2
# Once your clients are clean, enforce signing (2 = require signing)
reg add HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Parameters /v LDAPServerIntegrity /t REG_DWORD /d 2
Support for signing is common among non-Windows systems, but channel binding support is rare, so expect to chase down a few appliances. Microsoft’s LDAP signing page has the full event table and Group Policy paths.
Kerberos RC4
RC4 for Kerberos is the encryption type that makes Kerberoasting easy. Microsoft’s guidance is to disable it, and on Windows Server 2025 it’s being moved to off by default, but don’t just trust that in a long-lived domain with service accounts that were created in 2012. Audit your service accounts’ supported encryption types, set them to AES where you can, and plan for the handful of old applications that will complain.
Step 6: Lock down Remote Desktop
RDP is still how a lot of intrusions get started, usually through an exposed port or a reused password. Minimum standard:
- Never expose 3389 to the internet. Not “temporarily,” not with a non-standard port. Use a VPN, an RD Gateway, or Azure Bastion.
- Require Network Level Authentication:
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name UserAuthentication -Value 1 - Scope the firewall rule to your admin subnets or jump host:
Get-NetFirewallRule -DisplayGroup "Remote Desktop" | Set-NetFirewallRule -RemoteAddress 10.10.50.0/24 - Restrict who can log on through Remote Desktop Services using the “Allow log on through Remote Desktop Services” user right, not just whoever happens to be a local admin.
- Put MFA in front of administrative access wherever your tooling allows it.
Step 7: Control what runs on the server
Servers run a fairly predictable set of software, which makes them great candidates for application allowlisting. Most shops skip it because it sounds hard. It’s less hard than cleaning up after ransomware.
- WDAC (App Control for Business) is the stronger option because it enforces at the kernel level and a local admin can’t just turn it off. AppLocker is easier to roll out in smaller, static environments, but it’s less tamper-resistant.
- Start in audit mode for a couple of weeks. In the CodeIntegrity operational log, event 3076 shows what would have been blocked, and event 3077 is a real block once you’re enforcing.
- Build your policy from that audit data (the WDAC Policy Wizard helps), then switch to enforcement one server role at a time.
Alongside that, make sure Microsoft Defender Antivirus is running with Tamper Protection on, and consider Attack Surface Reduction rules, again starting in audit mode. For endpoint detection on servers, that’s Microsoft Defender for Endpoint (the product formerly called Defender ATP), or whatever EDR you’ve standardized on. The key is that something is watching the server, and that the alerts go to a person.
Step 8: Logging you’ll be glad you had
Hardening reduces the odds of a compromise. Logging is how you find out when it happens anyway. Three things to do on every server:
- Increase the Security log size. The default is far too small for a busy server and will roll over before you ever look at it.
wevtutil sl Security /ms:1073741824 # 1 GB - Turn on advanced audit policy (logon events, account management, process creation, and directory service changes on DCs), and enable command-line capture in process creation events (4688).
- Turn on PowerShell script block logging through Group Policy so you can see what attackers actually ran.
Then forward those logs somewhere an attacker on the box can’t delete them: Windows Event Forwarding, a SIEM, or Azure Monitor. Here’s a quick way to pull failed logons while you’re troubleshooting:
Get-WinEvent -FilterHashtable @{
LogName = 'Security'
Id = 4625
StartTime = (Get-Date).AddHours(-24)
} | Select-Object TimeCreated,
@{n='Account'; e={$_.Properties[5].Value}},
@{n='SourceIP'; e={$_.Properties[19].Value}} |
Group-Object SourceIP | Sort-Object Count -Descending | Select-Object -First 10
Events worth alerting on: 1102 (audit log cleared), 4720 (user account created), 4728/4732/4756 (member added to a privileged group), 4672 (special privileges assigned at logon, in context), and a burst of 4625 failures from a single source.
Azure-hosted Windows Servers: what changes
Microsoft takes care of the physical hosts and the hypervisor. Everything inside the VM is still your job, and the network edge works differently than on-prem. Everything above still applies, plus:
Don’t give the VM a public IP for management
Use Azure Bastion for browser-based RDP and SSH without public IPs or open management ports. If you must open ports occasionally, use just-in-time VM access in Microsoft Defender for Cloud so the port is only open for a limited time and for an approved source. Microsoft’s networking team has a nice piece on combining Bastion with Entra PIM so the access itself is time-boxed and approved.
Audit what’s currently exposed:
az network nsg rule list -g <resource-group> --nsg-name <nsg-name> `
--query "[?access=='Allow' && direction=='Inbound'].{name:name, port:destinationPortRange, source:sourceAddressPrefix}" -o table
Anything with a source of *, Internet, or 0.0.0.0/0 on ports 3389, 5985, 5986, 445 or 22 is a finding. Fix it today.
Use Trusted Launch and encryption
- Trusted Launch (Secure Boot, vTPM, and integrity monitoring) protects against boot-level malware and rootkits, and it’s the default for new Gen2 VMs with supported images and sizes. For older VMs, you can upgrade them to Trusted Launch and enforce adoption with Azure Policy.
- Encryption at host (and customer-managed keys if your compliance team needs them) protects OS and data disks.
Tie identity to Entra ID
- Sign in to Windows VMs with Entra ID credentials, with Conditional Access and MFA in front, instead of local accounts.
- Use Azure RBAC with least privilege on the subscription and resource group, and PIM for anything elevated.
- Keep Windows LAPS working for local admin passwords on VMs that are domain or Entra joined.
Turn on the monitoring you’re paying for anyway
- Microsoft Defender for Servers covers vulnerability scanning, EDR, and file integrity monitoring.
- Azure Update Manager for patch orchestration, with maintenance windows.
- Azure Policy / machine configuration to audit and enforce your OS baseline across the whole estate.
- Azure Arc to extend all of that to your on-prem and other-cloud servers, so you have one place to see the whole fleet.
Microsoft Learn also has a free learning path on securing servers and VMs that walks through Bastion, JIT, Trusted Launch, and Defender for Servers if you want something more guided.
Backups: the last line of defense
If everything above fails, backups decide whether you have a bad week or a company-ending one. Keep at least one copy that’s immutable or offline, so ransomware that gets domain admin can’t delete it. Back up domain controllers’ system state. And actually do a test restore on a schedule, because a backup you’ve never restored is a hope, not a backup.
A prioritized checklist you can work through
This week
- Patch anything on the exploited list. Confirm no WSUS server is reachable from the internet.
- Make sure no server has RDP, WinRM, or SMB open to the internet (on-prem firewall and Azure NSGs).
- Disable the Print Spooler on DCs and non-print servers. Confirm SMBv1 is off.
- Confirm every 2025 domain controller has the BadSuccessor fix.
- Increase Security log size and verify logs are being forwarded.
This month
- Deploy Windows LAPS to all servers.
- Verify Credential Guard is running. Put admin accounts in Protected Users.
- Turn on NTLM, SMB, and LDAP auditing and start reading the results.
- Apply a security baseline to a pilot group of servers.
- Move Azure management access to Bastion and JIT.
This quarter
- Enforce SMB signing and LDAP signing/channel binding after cleaning up the offenders.
- Start restricting NTLM and plan the RC4 retirement.
- Roll out WDAC or AppLocker in audit mode, then enforce by role.
- Build an admin tiering model and a privileged access workstation process.
- Run a restore test and write down how long it took.
More reading from other sysadmins
I’m not the only one writing about this, and I’ve learned plenty from other admins’ blogs. If you want a second opinion or a different angle on any of the above, these are worth your time (they all open in a new tab):
- ComputingForGeeks: Windows Server 2025 NTLM and Kerberos RC4, audit and restrict, a hands-on lab walkthrough that goes from NTLM auditing all the way to blocking.
- Computer Tips and Tricks: Windows Server Security Best Practices, a prioritized checklist for 2025 that also applies to 2022.
- phinit.de: Windows Server Hardening blueprint, with a defense-in-depth take covering Credential Guard, WDAC/AppLocker, and audit policy.
- a7.de: Windows Server hardening with CIS Benchmark and Microsoft baselines, a step-by-step guide with a suggested rollout order.
- NHIMG: Windows Server Hardening Guide, covering baselines, role servers, and attack surface reduction for 2019, 2022 and 2025.
- hans.study: What changed in Windows Server 2025 and what it breaks, useful before you migrate anything with a vendor plugin attached to it.
- Hawktrace: CVE-2025-59287 WSUS analysis, the original technical write-up on the WSUS bug.
Wrapping up
Hardening a Windows Server environment isn’t one big project. It’s a pile of small, unglamorous changes made in the right order: patch fast, shrink the attack surface, protect credentials, retire legacy protocols carefully, control what runs, and log enough to notice trouble. Windows Server 2025 gives you a better starting point than any previous release, but you still have to verify it and finish the job.
If you spot something I got wrong, or you’ve found a better way to handle one of these steps, leave a comment. Settings and defaults in this area change often, so double-check anything critical against Microsoft’s current documentation before rolling it into production.