IRONSMITHINTEL
HIGH
|Auth: none (without nla)|Reboot: not required|Est. 10 minutes|✓ ScriptJump to Patch ↓

Enforce NLA on RDP to Require Credentials Before the Remote Desktop Session Loads

Without NLA, anyone can reach the Windows login screen over RDP and attempt brute force — NLA forces authentication before the session is established, blocking pre-auth exploits and reducing the attack surface.

✓ Tested on WS2022·Rollback included

Published May 7, 2026 · Updated May 7, 2026
Why patchRisk explained in plain English
Worst-case scenarioIf unpatched

Without NLA, an attacker can connect to RDP and attempt unlimited password guessing against the login screen without any pre-authentication. Internet-facing RDP servers without NLA are continuously scanned and attacked by automated tools. Additionally, pre-auth vulnerabilities like BlueKeep only affect servers without NLA.

How the attack works

Remote Desktop Protocol (RDP) without Network Level Authentication allows any network-accessible client to initiate a full RDP session and reach the Windows login screen. This exposes the login interface to brute-force attacks, credential stuffing, and pre-authentication RDP vulnerabilities such as BlueKeep (CVE-2019-0708). NLA requires the connecting client to authenticate at the network layer before any desktop session is created, significantly reducing the attack surface.

Am I affected?Quick check

Probably yes if any of these apply:

All Windows Servers with RDP enabled
Remote Desktop Session Hosts
Jump hosts
Running NLA not required (UserAuthentication = 0)

Affected OS versions

Windows Server 2016Windows Server 2019Windows Server 2022
Fixed inNLA required (UserAuthentication = 1)
Real-world incidentsWhat we've seen

RDP brute force is one of the most common initial access vectors for ransomware. Automated scanners continuously probe the internet for port 3389, and servers without NLA that use weak passwords are compromised within hours. Enabling NLA ensures that only already-authenticated users can reach the login interface.

How to patchRecommended: PowerShell script
Script Package✓ Tested WS2022
v1.0.0

Fix-Windows-Server-Rdp-Nla-Enforced-Hardening.ps1

4.0 KB
↓ Download Fix

Rollback-Windows-Server-Rdp-Nla-Enforced-Hardening.ps1

1.7 KB
↓ Download Rollback

SHA-256: d4b07636d870e3b139d95af6ee7dd7e3aa7a97801eeef75c25ea48ed0ffc8a55

Run interactively

.\Fix-Windows-Server-Rdp-Nla-Enforced-Hardening.ps1

Run silently (SCCM / Intune)

.\Fix-Windows-Server-Rdp-Nla-Enforced-Hardening.ps1 -Silent -OutputPath C:\Logs

Manual fallback (no script)

10 minutes

Check Current NLA Status

$ts = Get-WmiObject -Class Win32_TerminalServiceSetting -Namespace root\CimV2\TerminalServices
Write-Host "UserAuthentication: $($ts.UserAuthentication)"
if ($ts.UserAuthentication -eq 1) {
    Write-Host "SECURE: NLA is required" -ForegroundColor Green
} else {
    Write-Host "VULNERABLE: NLA is not required" -ForegroundColor Red
}

Enable NLA Requirement

# Method 1: WMI
$ts = Get-WmiObject -Class Win32_TerminalServiceSetting -Namespace root\CimV2\TerminalServices
$ts.SetUserAuthenticationRequired(1)

# Method 2: Registry
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name UserAuthentication -Value 1 -Type DWord

Verification

(Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp').UserAuthentication
# Must return 1

Notes

    1
    Takes effect immediately, no reboot required
    1
    Existing RDP sessions are not disconnected
    1
    All modern Windows clients (Vista and later) support NLA — legacy clients may need to use different remote access methods

Verify after patching

Confirm the patched version is running:

# Expect: NLA required (UserAuthentication = 1) or later
Script details · parameters · exit codes
Script Packagev1.0.0 · Tested WS2022 · Rollback included
✓ Fully tested
Fix Script
Fix-Windows-Server-Rdp-Nla-Enforced-Hardening.ps1
↓ Download
Rollback Script
Rollback-Windows-Server-Rdp-Nla-Enforced-Hardening.ps1
↓ Download
SHA-256 verified · Hashes confirmed on download

Tested On

Reboot

No Reboot

SCCM

✓ Compatible

Est. Time

10 minutes

Parameters

-SilentSuppress all console output. Always used when called via API or SCCM.
-OutputPathDirectory for log files and downloaded installers. Defaults to script directory.

How to Run

Interactive — see output in console

.\Fix-Windows-Server-Rdp-Nla-Enforced-Hardening.ps1

Silent mode — for SCCM / automation

.\Fix-Windows-Server-Rdp-Nla-Enforced-Hardening.ps1 -Silent

With custom log path

.\Fix-Windows-Server-Rdp-Nla-Enforced-Hardening.ps1 -OutputPath "C:\Logs"

Exit Codes

CodeMeaning
0Success — fix applied or already patched
1Failure — check log file
3010Success — reboot required to complete
✓ Fully tested

Fix, idempotency, and rollback verified on

⚠ Rollback available. If this fix causes issues, run Rollback-Windows-Server-Rdp-Nla-Enforced-Hardening.ps1 to restore the previous state.