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.
Domain controllers refuse the weakest sign-in methods.
LM and NTLMv1 can be cracked in minutes with free tools.
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.
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| Column | What you want |
|---|---|
| NTLMv1SignIns | 0. Anything higher means a device still uses NTLMv1. Find it and fix it before you carry on. |
| NTLMv2SignIns | Any number. These keep working. |
| LogStartsFrom | How 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
$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-NullLevel 5 means: send NTLMv2 only, and refuse LM and NTLMv1 from others.
Apply and check
$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={$_}} -AutoSizeEvery 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
Every domain controller shows level 5, and scan-to-folder and other shared devices still work.


