Guide

Refuse old NTLM versions

NTLM is the older way Windows proves who you are. Its first versions, LM and NTLMv1, can be cracked in minutes. This setting makes domain controllers refuse them and accept only NTLMv2.

15 minutesRun as a domain admin on CON-DC-01
What improves

Domain controllers refuse the weakest sign-in methods.

Why it matters

LM and NTLMv1 can be cracked in minutes with free tools.

How you do it

Check nothing still uses NTLMv1, then set LmCompatibilityLevel to 5 on the domain controllers.

Check nothing still uses NTLMv1

Old photocopiers, scanners and storage boxes sometimes only speak NTLMv1. Count the sign-ins on each domain controller that used it.

CON-DC-01
Invoke-Command -ComputerName (Get-ADDomainController -Filter *).HostName -ScriptBlock {
    $count = {
        param($pkg)
        @(Get-WinEvent -LogName Security -FilterXPath "*[System[EventID=4624] and EventData[Data[@Name='LmPackageName']='$pkg']]" -ErrorAction SilentlyContinue).Count
    }
    [pscustomobject]@{
        NTLMv1SignIns = & $count 'NTLM V1'
        NTLMv2SignIns = & $count 'NTLM V2'
        LogStartsFrom = (Get-WinEvent -LogName Security -Oldest -MaxEvents 1).TimeCreated
    }
} | Format-Table PSComputerName, NTLMv1SignIns, NTLMv2SignIns, LogStartsFrom -AutoSize
ColumnWhat you want
NTLMv1SignIns0. Anything higher means a device still uses NTLMv1. Find it and fix it before you carry on.
NTLMv2SignInsAny number. These keep working.
LogStartsFromHow far back the count goes. A log that covers only a day or two proves less.

The search reads the whole Security log, so it can take a minute. Windows Server 2025 no longer supports NTLMv1 at all, so on those servers the count is always 0.

Set the policy

CON-DC-01
$dom = Get-ADDomain
if (-not (Get-GPO -Name 'CON-DC-Hardening' -ErrorAction SilentlyContinue)) {
    New-GPO -Name 'CON-DC-Hardening' -Comment 'Security settings for domain controllers' |
        New-GPLink -Target "OU=Domain Controllers,$($dom.DistinguishedName)" | Out-Null
}
Set-GPRegistryValue -Name 'CON-DC-Hardening' -Key 'HKLM\SYSTEM\CurrentControlSet\Control\Lsa' -ValueName 'LmCompatibilityLevel' -Type DWord -Value 5 | Out-Null

Level 5 means: send NTLMv2 only, and refuse LM and NTLMv1 from others.

Apply and check

CON-DC-01
$dcs = (Get-ADDomainController -Filter *).HostName
Invoke-Command -ComputerName $dcs -ScriptBlock { gpupdate /force | Out-Null }
Invoke-Command -ComputerName $dcs -ScriptBlock {
    (Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Lsa').LmCompatibilityLevel
} | Format-Table PSComputerName, @{n='LmCompatibilityLevel';e={$_}} -AutoSize

Every DC should show 5. No restart is needed.

If something stops signing in

Set the value to 3 in the policy and run gpupdate /force on each DC. That accepts the old versions again while you fix the device.

Done when

Check

Every domain controller shows level 5, and scan-to-folder and other shared devices still work.

Your progress is kept in this browser only.