I would like to write a batch script to change the
Local Security Policy -> LAN Manager Authentication Level
to "Send LM & NTLM - use the NTLMv2 session security if negotiated".
I added the following statement to my batch script to achieve this:
reg add HKLM\System\CurrentControlSet\Control\Lsa\LmCompatibilityLevel /t REG_SZ /d 1 /f
I can see in the registry editor that the value was updated, however when I go to
Local Security Policy -> Local Policies -> Security Options -> Network security LAN Manager -> Authentication level
the security setting still shows up as "Not Defined" instead of "Send LM & NTLM - use NTLMv2 session security if negotiated".
Am I doing something wrong?
Is there another way to automate this using a batch script?
Referenced Article:
https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/network-security-lan-manager-authentication-level
Your registry value is wrong type (
/t REG_SZ
in yourreg add
command). It is aREG_DWORD
value, so yourLmCompatibilityLevel
added value is ignored.Try instead:
Otherwise you could also use domain group policy instead of a batch script.