Enable SMB Signing

email me

Scripting

reg add “HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkStation\Parameters” /v “RequireSecuritySignature” /t REG_DWORD /d 1 /f

reg add “HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkStation\Parameters” /v “EnableSecuritySignature” /t REG_DWORD /d 1 /f

reg add “HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Parameters” /v “RequireSecuritySignature” /t REG_DWORD /d 1 /f

reg add “HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Parameters” /v “EnableSecuritySignature” /t REG_DWORD /d 1 /f

 

Return the current state of  SMB
Get-SmbServerConfiguration | Select EnableSMB1Protocol, EnableSMB2Protocol

Disables the SMBv1 on the SMB server by running the below command
Set-SmbServerConfiguration -EnableSMB1Protocol $false

Disables the SMBv2 and SMBv3 on the SMB server by running the below command
Set-SmbServerConfiguration -EnableSMB2Protocol $false

Enables the SMBv1 on the SMB server by running the below command
Set-SmbServerConfiguration -EnableSMB1Protocol $true

Enables the SMBv2 and SMBv3 on the SMB server by running the below command
Set-SmbServerConfiguration -EnableSMB2Protocol $true


Using Windows PowerShell 2.0 or later version

Disables the SMBv1 on the SMB server by running the below command
Set-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters” SMB1 -Value 0 –Force

Disables the SMBv2 and SMBv3 on the SMB server by running the below command
Set-ItemProperty –Path “HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters” SMB2 –Value 0 –Force

Enables the SMBv1 on the SMB server by running the below command
Set-ItemProperty –Path “HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters” SMB1 –Value 1 –Force

Enables the SMBv2 and SMBv3 on the SMB server by running the below command
Set-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters” SMB2 -Value 1 -Force