Skip to content

Instantly share code, notes, and snippets.

@CodyMathis123
Created November 4, 2019 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodyMathis123/7ff76dc865b0cceb1be67188332a4c52 to your computer and use it in GitHub Desktop.
Save CodyMathis123/7ff76dc865b0cceb1be67188332a4c52 to your computer and use it in GitHub Desktop.
#region detection
$SitePath = 'WSUS Administration/Content'
$getWebConfigurationPropertySplat = @{
Filter = '/system.webServer/security/Access'
Name = 'sslFlags'
PSPath = 'MACHINE/WEBROOT/APPHOST'
Location = $SitePath
}
try {
Get-WebConfigurationProperty @getWebConfigurationPropertySplat | Select-Object -ExpandProperty Value -ErrorAction Stop
}
catch {
1
}
#endregion detection
#region remediation
$SitePath = 'WSUS Administration/Content'
$setWebConfigurationPropertySplat = @{
Filter = '/system.webServer/security/Access'
PSPath = 'MACHINE/WEBROOT/APPHOST'
Name = 'sslFlags'
Location = $SitePath
Value = 'None'
}
Set-WebConfigurationProperty @setWebConfigurationPropertySplat
#endregion remediation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment