EDIT – Since I posted this MS have provided a method via GPO using some new admx:
https://blogs.technet.microsoft.com/secguide/2017/06/15/disabling-smbv1-through-group-policy/
I would now recommend using the admx approach to disable it, but then deploy the below baselines in monitor mode only so you have some reporting on if your GPO is working.
Put simply you should stop using SMB1 right away. If you regularly scan your systems using something like Tenable Nessus you may have noticed that SMB1 being enabled is marked as a “Critical” and without disabling it you are likely to fail your compliance for systems which should meet standards such as PCI.
Ned Pyle at Microsoft posted an excellent article on why SMB1 is no longer safe or appropriate. You can read it here.
Once you have read this your next step is going to be to disable it and remove it (Server 2012 R2+/8.1+) or disable it (Server 2012/2008/7). If you are worried about what might break here are some things to check first:
- Are you using any MFDs with ancient firmware which use features such as scan to share or offer a share to upload content for print? If so check for firmware updates or within the systems to see if you can enable at least SMB2
- If your shared storage is based on something like NetApp Data ONTAP make sure that your storage admins have enabled at least SMB2. ONTAP 8.2 and later support SMB3 so if you can enable this too you should see some benefits for your Windows 10 clients
- If you still have any XP or Server 2003 clients get rid of them, they only support SMB1
Sadly there is no GPO option to disable SMB1 client or server, and the method to disable it differs across the versions. In order to disable it and be able to report it on I am using DSC within ConfigMgr.
Configuration Items Required
We’re going to need four configuration items in our baseline:
- Disable SMB1 on Windows 8 / Server 2012 and above
- Remove SMB1 on Windows 8.1 / Server 2012 R2 and above
- Disable SMB1 Client on Windows 7 / 2008 R2
- Disable SMB1 Server on Windows 7 / 2008 R2
Disable SMB1 on Windows 8 / Server 2012 and above
Create the new configuration item and select only the Supported Platforms of:
In the Settings tab make a new setting of the type “Script” called “SMB1 Disabled”.
For your discovery script use:
$smbenabled = Get-SmbServerConfiguration | Select EnableSMB1Protocol echo $smbenabled.EnableSMB1Protocol
For your remediation script use:
Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force
Move onto the “Compliance Rules” tab and create a new rule as follows:
Hit OK and close and that’s your first one done.
Remove SMB1 on Windows 8.1 / Server 2012 R2 and above
Create another configuration item as before, this time your supported platforms should be as follows:
Create the new setting with the following Discover and Remediation scripts:
Discovery
$smb1 = Get-WindowsOptionalFeature -Online -FeatureName smb1protocol echo $smb1.State
Remediation
Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol -Norestart
Note that here I have added -norestart to prevent the systems from rebooting immediately. At the next scheduled reboot SMB1 will be fully removed.
Create the compliance rule as follows:
Two down, two to go.
Disable SMB1 Client on Windows 7 / 2008 R2
No need to teach you how to suck eggs so this time create a configuration item with Supported Platforms of Windows 7 and Windows 2008 (this covers 2008 R2 also if you tick the box at the top level).
This one is slightly more tricky. Whilst disabling the SMB client is the small matter of running a couple of sc.exe commands detecting the status is more difficult. In order disable the SMB1 client we remove the dependency of “SMB 1.x MiniRedirector” from the Workstation service and then disable it. Before starting, in the GUI it looks like this:
We need to discover if the “SMB 1.x MiniRedirector” has been removed from the dependencies and we want to do it with PowerShell.
$smb1 = Get-Service -name LanManWorkstation -RequiredServices | where { $_.Name -eq "MrxSmb10"} echo $smb1
If the “SMB 1.x MiniRedirector” has not been removed from the Workstation service the command will return this:
If it has been removed then the command will return nothing.
By simply adding an if statement we can test for the null value and return a true/false result to ConfigMgr
$smb1 = Get-Service -name LanManWorkstation -RequiredServices | where { $_.Name -eq "MrxSmb10"} if ($smb1 -eq $null) {$Compliant = "True"} else {$Compliant = "False"} echo $Compliant

sc.exe config lanmanworkstation depend= bowser/mrxsmb20/nsi sc.exe config mrxsmb10 start= disabled
This can be specified as a PowerShell script as calling sc from PowerShell is fine provided we use sc.exe. sc is an alias for Set-Content in PowerShell.
This does need a reboot to take effect but once again we’ll assume that you are happy to wait until your next scheduled restart rather than forcing it. If you need to force any of these just add a Restart-Computer command to the end of your remediation script. You may also want to add a Write-Eventlog command to add something to the event log to show why the computer was restarted.
Disable SMB1 Server on Windows 7 / 2008 R2
Use the same supported platforms as in the previous item.
This time for your settings you want a registry rule as follows:
The required compliance rules are as follows:
Ensure that you have ticked the “remediate noncompliant rules when supported” box for your SMB Equals 0 rule.
Create and deploy our Baseline
With the four configuration items in place create a baseline and add the four conditions to it:
Deploy this to a collection and enable remediation and all your SMB1 problems will disappear!
>>In the Settings tab make a new setting of the type “Script” >>called “SMB1 Disabled”.
For three of the 4 Configuration Item settings that are of the type ‘script’ – what is the Data type? String? Boolean?
LikeLike
Hi, they are boolean as the scripts will return either “true” or “false”.
LikeLike
For your discovery script for Windows 8.1/Server 2012+, you don’t need to echo out the value, just use select -expand like this:
Get-SmbServerConfiguration | Select -Expand EnableSMB1Protocol
LikeLike
Thanks, this looks great.
I created a Baseline only for Windows 10 OS, used your script for disable SMBv1.
Deployed the Baseline to a collection with 5 test machines… they stay in Unknown all the time… I have it to run every 5 minutes… followed your steps and used Boolean. Any ideas what is missing?
LikeLike
Ok my bad, for some reaons these test clients had: Enable compliance evaluation on clients = off, please ignore my previous post 🙂 still huge thanks! great solution.
LikeLike
Have you actually tested the 2008 R2 server remediation? I don’t think it works. Error code: 0x80041002 not found (and it doesn’t create the entry)
LikeLike
Yes using it across many thousands of Win 7 machines and 2008 R2. Will check the code when I get a moment, could be a typo in the blog post perhaps…
LikeLike
I’ve checked it out and I’ve not seen that error on any clients. Make sure that all the scripts work manually by running them via PowerShell. If they work okay from there it point to some sort of client issue. That error code is WMI related.
Is the error occurring at discover or remediation?
LikeLike
Error is occurring at discover. I believe the error is that the registry key doesn’t exist.
When I run it using powershell I get an error about the property not existing:
http://imgur.com/a/BfqJH
LikeLike
I get the same issue on Win 7.
LikeLike
What version of Powershell are you running on your Win7 boxes? Also check what happens if you run the commands manually.
I’ve only tested this on x64 as well, we don’t run any x86.
LikeLike
The key wouldn’t exist until after the remediation. I just tested it on a Win7 client by deleting the key then running the evaluation and the key was restored.
DCMWmiProvider.log might show what is going on.
LikeLike
Have you seen cases where systems that have had the workstation service dependency on SMB1 disabled changing the startup type for workstation service to disabled? We’ve seen more than one since we introduced this in our environment on a limited basis.
LikeLike
Hi, no I’ve not seen that. You could test by renabling SMB1 then running the remidiation like by line to see what happens.
LikeLike