Disable SMBv1

%3CLINGO-SUB%20id%3D%22lingo-sub-3289007%22%20slang%3D%22en-US%22%3EDisable%20SMBv1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3289007%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI'm%20in%20the%20process%20of%20disabling%20SMBv1%20for%20large%20scale%20servers.%20I%20made%20a%20script%20for%20this%2C%20and%20this%20results%20that%20SMBv1%20on%20registry%20and%20feature%20level%20is%20almost%20disabled%20or%20does%20not%20exist%20everywhere.%3C%2FP%3E%3CP%3EHowever%2C%20when%20I%20run%20the%20following%20command%20%22Get-SmbServerConfiguration%20%7C%20Select%20EnableSMB1Protocol%22%2C%20this%20results%20that%20SMBv1%20is%20set%20to%20True.%20I%20can't%20really%20gauge%20if%20everything%20is%20really%20off%20now.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBecause%20when%20I%20run%20the%20commands%20below%2C%20it's%20off.%3C%2FP%3E%3COL%3E%3CLI%3EGet-WindowsOptionalFeature%20-Online%20-FeatureName%20SMB1Protocol%3C%2FLI%3E%3CLI%3EGet-Item%20HKLM%3A%5CSYSTEM%5CCurrentControlSet%5CServices%5CLanmanServer%5CParameters%20%7C%20ForEach-Object%20%7BGet-ItemProperty%20%24_.pspath%7D%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%3CBR%20%2F%3EBut%20when%20I%20run%20this%20command%20it%20result%20that%20its%20on.%3C%2FP%3E%3COL%3E%3CLI%3EGet-SmbServerConfiguration%20%7C%20Select%20EnableSMB1Protocol%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20know%20how%20to%20disable%20this%2C%20but%20what%20exactly%20is%20the%20difference%3F%3C%2FP%3E%3CP%3EAnd%20is%20it%20really%20still%20on%3F%3C%2FP%3E%3CP%3EHopefully%20someone%20can%20enlighten%20me%20on%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3289007%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESMBv1%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EStorage%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3290121%22%20slang%3D%22en-US%22%3ERe%3A%20Disable%20SMBv1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3290121%22%20slang%3D%22en-US%22%3EThank%20you.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3290107%22%20slang%3D%22en-US%22%3ERe%3A%20Disable%20SMBv1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3290107%22%20slang%3D%22en-US%22%3EIf%20you%20removed%20SMB1%20binaries%2C%20my%20guess%20is%20the%20server%20is%20already%20unable%20to%20respond%20using%20the%20corresponding%20protocol%20-%20I'm%20pretty%20sure%20you%20are%20safe%20if%20you%20disable%20SMB1%20protocol.%3CBR%20%2F%3E%3CBR%20%2F%3EFrom%20my%20link%20%3A%20%22When%20SMBv1%20auditing%20is%20enabled%2C%20event%203000%20appears%20in%20the%20%22Microsoft-Windows-SMBServer%5CAudit%22%20event%20log%2C%20identifying%20each%20client%20that%20attempts%20to%20connect%20with%20SMBv1.%22%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3290061%22%20slang%3D%22en-US%22%3ERe%3A%20Disable%20SMBv1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3290061%22%20slang%3D%22en-US%22%3EI%20already%20did%20a%20check%20myself%2C%20and%20this%20check%20shows%20that%20the%20feature%20is%20disabled%20everywhere%3CBR%20%2F%3EThe%20only%20thing%20that%20is%20enabled%20at%20server%20level%20is%20based%20on%20the%20following%20protocol%20%22Get-SmbServerConfiguration%20%7C%20Select%20EnableSMB1Protocol%22.%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20I%20only%20have%201%20step%20left%20to%20perform%20which%20is%3A%20%22Set-SmbServerConfiguration%20-EnableSMB1Protocol%20%24false%22%20to%20disable%20this%20protocol%20too.%3CBR%20%2F%3E%3CBR%20%2F%3EHow%20do%20I%20audit%20SMBv1%20usage%3F%20Or%20is%20that%20no%20longer%20necessary%20in%20this%20case%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3290052%22%20slang%3D%22en-US%22%3ERe%3A%20Disable%20SMBv1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3290052%22%20slang%3D%22en-US%22%3EIn%20that%20case%2C%20I%20would%20only%20disable%20SMB1%20protocol%20(third%20step)%20first%20-%20a%20rollback%20will%20only%20require%20to%20turn%20it%20on%20again.%3CBR%20%2F%3EUninstalling%20the%20Windows%20feature%20means%20uninstall%20binaries%20-%20a%20rollback%20will%20require%20more%20work.%3CBR%20%2F%3E%3CBR%20%2F%3EYou%20may%20wish%20to%20audit%20your%20server%20for%20SMB1%20usage%20before%20any%20change.%20A%20Powershell%20one-liner%20is%20enough%20to%20do%20that%20%3A%20Set-SmbServerConfiguration%20-AuditSmb1Access%20%24true%3CBR%20%2F%3E%3CBR%20%2F%3ECheck%20this%20for%20more%20info%20%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fstorage%2Ffile-server%2Ftroubleshoot%2Fdetect-enable-and-disable-smbv1-v2-v3%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows-server%2Fstorage%2Ffile-server%2Ftroubleshoot%2Fdetect-enable-and-disable-smbv1-v2-v3%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3290024%22%20slang%3D%22en-US%22%3ERe%3A%20Disable%20SMBv1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3290024%22%20slang%3D%22en-US%22%3EYes%2C%20exactly%20what%20you%20say%2C%20that's%20what%20I%20thought%20too.%3CBR%20%2F%3EThe%20first%202%20steps%20in%20my%20believing%20should%20be%20enough%2C%20but%20I'm%20going%20to%20do%20the%20last%20step%20anyway.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20only%20reason%20I'm%20asking%20this%20is%20because%20I%20want%20to%20make%20sure%20I%20can%20do%20the%20last%20step%20so%20(Set-SmbServerConfiguration%20-EnableSMB1Protocol%20%24false)%20without%20any%20risk.%3CBR%20%2F%3ESo%20assuming%20that%20the%20first%202%20steps%20have%20been%20performed%20and%20so%20the%20feature%20is%20disabled%2C%20this%20should%20mean%20that%20SMBv1%20is%20no%20longer%20used.%3CBR%20%2F%3ESo%20when%20I%20perform%20the%20last%20step%2C%20I%20actually%20want%20to%20be%20sure%20(provided%20that%20the%20feature%20is%20disabled)%20whether%20this%20has%20no%20consequences%20that%20SMB1%20is%20used%20in%20one%20way%20or%20another%20or%20something%20like%20that%20if%20you%20understand%20what%20I%20mean.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3289900%22%20slang%3D%22en-US%22%3ERe%3A%20Disable%20SMBv1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3289900%22%20slang%3D%22en-US%22%3EIf%20I'm%20right%20the%20last%20step%20disable%20SMB1%20protocol%20on%20the%20server%20side%20-%20without%20uninstalling%20the%20feature%20entirely%20(checked%20by%20the%20first%20step).%3CBR%20%2F%3E%3CBR%20%2F%3EUnless%20I'm%20mistalen%20uninstalling%20the%20feature%20should%20be%20enough%20in%20theory.%20However%2C%20you%20should%20keep%20such%20critical%20security%20settings%20consistent%20between%20servers%20as%20much%20as%20possible.%20Thus%20I%20recommend%20to%20both%20configure%20%22EnableSMB1Protocol%22%20to%20%22%24false%22%20AND%20uninstall%20the%20feature.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3289275%22%20slang%3D%22en-US%22%3ERe%3A%20Disable%20SMBv1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3289275%22%20slang%3D%22en-US%22%3EThanks%20for%20your%20reply.%3CBR%20%2F%3E%3CBR%20%2F%3ENo%2C%20I%20haven't%20done%20anything%20yet.%20I%20have%20been%20asked%20to%20investigate%20where%20SMBv1%20is%20still%20enabled.%3CBR%20%2F%3EAnd%20my%20script%20only%20checked%20where%20SMBv1%20is%20still%20enabled%20on%20server%20level.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20check%20actually%20does%203%20steps%3A%3CBR%20%2F%3E1.%20Get-WindowsOptionalFeature%20-Online%20-FeatureName%20SMB1Protocol%3CBR%20%2F%3E2.%20Get-Item%20HKLM%3A%5CSYSTEM%5CCurrentControlSet%5CServices%5CLanmanServer%5CParameters%20%7C%20ForEach-Object%20%7BGet-ItemProperty%20%24_.pspath%7D%3CBR%20%2F%3E3.%20Get-SmbServerConfiguration%20%7C%20Select%20EnableSMB1Protocol%3CBR%20%2F%3E%3CBR%20%2F%3EThis%20showed%20that%20based%20on%20the%20last%20step%2C%20SMBv1%20is%20still%20set%20to%20True.%3CBR%20%2F%3EBased%20on%20the%20first%202%20steps%2C%20SMBv1%20is%20disabled.%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20my%20question%20is%2C%20are%20the%20first%202%20steps%20sufficient%20to%20disable%20SMBv1%2C%20apart%20from%20the%20fact%20that%20I%20can%20disable%20it%20with%20the%20command%20below.%20Or%20should%20the%20latter%20also%20be%20set%20to%20false%2C%20and%20is%20SMBv1%20still%20in%20use%20if%20the%20first%202%20steps%20are%20off%20except%20for%20the%20last%201%3F%3CBR%20%2F%3ESet-SmbServerConfiguration%20-EnableSMB1Protocol%20%24false%3CBR%20%2F%3E%3CBR%20%2F%3EI%20don't%20understand%20what%20the%20difference%20is%20between%20the%20first%202%20steps%20and%20the%20last%20step%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3289120%22%20slang%3D%22en-US%22%3ERe%3A%20Disable%20SMBv1%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3289120%22%20slang%3D%22en-US%22%3EHello%2C%3CBR%20%2F%3E%3CBR%20%2F%3EIt%20would%20depends%20on%20what%20you%20did%20through%20your%20script.%20Did%20you%20disable%20SMB1%20server%20side%20first%20then%20uninstall%20the%20feature%20after%20that%20%3F%20Something%20else%20%3F%20Did%20you%20restart%20target%20computers%20%3F%3CBR%20%2F%3E%3CBR%20%2F%3EOn%20a%20brand%20new%20WS%202019%2F2022%2C%20EnableSMB1Protocol%20is%20set%20to%20%22%24false%22%20and%20Windows%20Optional%20feature%20is%20set%20to%20%22Disabled%22.%3C%2FLINGO-BODY%3E
Occasional Visitor

Hello,

I'm in the process of disabling SMBv1 for large scale servers. I made a script for this, and this results that SMBv1 on registry and feature level is almost disabled or does not exist everywhere.

However, when I run the following command "Get-SmbServerConfiguration | Select EnableSMB1Protocol", this results that SMBv1 is set to True. I can't really gauge if everything is really off now.

 

Because when I run the commands below, it's off.

  1. Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
  2. Get-Item HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters | ForEach-Object {Get-ItemProperty $_.pspath}


But when I run this command it result that its on.

  1. Get-SmbServerConfiguration | Select EnableSMB1Protocol

 

I know how to disable this, but what exactly is the difference?

And is it really still on?

Hopefully someone can enlighten me on this?

 

Thanks in advance

8 Replies
Hello,

It would depends on what you did through your script. Did you disable SMB1 server side first then uninstall the feature after that ? Something else ? Did you restart target computers ?

On a brand new WS 2019/2022, EnableSMB1Protocol is set to "$false" and Windows Optional feature is set to "Disabled".
Thanks for your reply.

No, I haven't done anything yet. I have been asked to investigate where SMBv1 is still enabled.
And my script only checked where SMBv1 is still enabled on server level.

The check actually does 3 steps:
1. Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
2. Get-Item HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters | ForEach-Object {Get-ItemProperty $_.pspath}
3. Get-SmbServerConfiguration | Select EnableSMB1Protocol

This showed that based on the last step, SMBv1 is still set to True.
Based on the first 2 steps, SMBv1 is disabled.

So my question is, are the first 2 steps sufficient to disable SMBv1, apart from the fact that I can disable it with the command below. Or should the latter also be set to false, and is SMBv1 still in use if the first 2 steps are off except for the last 1?
Set-SmbServerConfiguration -EnableSMB1Protocol $false

I don't understand what the difference is between the first 2 steps and the last step?
If I'm right the last step disable SMB1 protocol on the server side - without uninstalling the feature entirely (checked by the first step).

Unless I'm mistalen uninstalling the feature should be enough in theory. However, you should keep such critical security settings consistent between servers as much as possible. Thus I recommend to both configure "EnableSMB1Protocol" to "$false" AND uninstall the feature.

Yes, exactly what you say, that's what I thought too.
The first 2 steps in my believing should be enough, but I'm going to do the last step anyway.

The only reason I'm asking this is because I want to make sure I can do the last step so (Set-SmbServerConfiguration -EnableSMB1Protocol $false) without any risk.
So assuming that the first 2 steps have been performed and so the feature is disabled, this should mean that SMBv1 is no longer used.
So when I perform the last step, I actually want to be sure (provided that the feature is disabled) whether this has no consequences that SMB1 is used in one way or another or something like that if you understand what I mean.
In that case, I would only disable SMB1 protocol (third step) first - a rollback will only require to turn it on again.
Uninstalling the Windows feature means uninstall binaries - a rollback will require more work.

You may wish to audit your server for SMB1 usage before any change. A Powershell one-liner is enough to do that : Set-SmbServerConfiguration -AuditSmb1Access $true

Check this for more info : https://docs.microsoft.com/en-us/windows-server/storage/file-server/troubleshoot/detect-enable-and-d...

I already did a check myself, and this check shows that the feature is disabled everywhere
The only thing that is enabled at server level is based on the following protocol "Get-SmbServerConfiguration | Select EnableSMB1Protocol".

So I only have 1 step left to perform which is: "Set-SmbServerConfiguration -EnableSMB1Protocol $false" to disable this protocol too.

How do I audit SMBv1 usage? Or is that no longer necessary in this case?
If you removed SMB1 binaries, my guess is the server is already unable to respond using the corresponding protocol - I'm pretty sure you are safe if you disable SMB1 protocol.

From my link : "When SMBv1 auditing is enabled, event 3000 appears in the "Microsoft-Windows-SMBServer\Audit" event log, identifying each client that attempts to connect with SMBv1."
Thank you.