Created
May 14, 2017 12:00
-
-
Save jhochwald/8d08ebe71cc33246114bcc5e32ec768c to your computer and use it in GitHub Desktop.
Powershell DSC to remove SMBv1 support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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