Skip to content

Instantly share code, notes, and snippets.

@jhochwald
Created May 14, 2017 12:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhochwald/8d08ebe71cc33246114bcc5e32ec768c to your computer and use it in GitHub Desktop.
Save jhochwald/8d08ebe71cc33246114bcc5e32ec768c to your computer and use it in GitHub Desktop.
Powershell DSC to remove SMBv1 support
#requires -Version 4.0 -Modules PSDesiredStateConfiguration
<#
Work on any modern Microsoft Server OS
#>
# change this to any existing Path
$WorkPath = 'C:\scripts'
configuration RemoveSMB1 {
param([string[]]$ComputerName = 'localhost')
Import-DscResource -ModuleName PSDesiredStateConfiguration
Node $ComputerName {
# Removes SMBv1 support, if installed (enforced)
WindowsFeature 'SMB1' {
Name = 'FS-SMB1'
Ensure = 'Absent'
}
}
}
RemoveSMB1 -OutputPath $WorkPath
Start-DscConfiguration -Wait -Path $WorkPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment