Windows Server 2012 R2 & 2016: PowerShell methods
Detect: SMB v1
Get-WindowsFeature FS-SMB1
Disable:
Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol
Enable:
Enable-WindowsOptionalFeature -Online -FeatureName smb1protocol
Detect: SMB v2/v3
Get-SmbServerConfiguration | Select EnableSMB2Protocol
Disable:
Set-SmbServerConfiguration -EnableSMB2Protocol $false
Enable:
Set-SmbServerConfiguration -EnableSMB2Protocol $true
Windows 8.1 and Windows 10: PowerShell method
Detect: SMB v1 Protocol
Get-WindowsOptionalFeature –Online –FeatureName SMB1Protocol
Disable:
Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
Enable:
Enable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
Detect: SMB v2/v3 Protocol
Get-SmbServerConfiguration | Select EnableSMB2Protocol
Disable:
Set-SmbServerConfiguration –EnableSMB2Protocol $false
Enable:
Set-SmbServerConfiguration –EnableSMB2Protocol $true
Read more about at Microsoft