Created
November 5, 2015 05:26
Revisions
-
sheastrickland created this gist
Nov 5, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ Script EnableIpSecurityOverride { #Allows override for system.webserver.security.ipSecurity in applicationHost.config DependsOn = "[Script]PreviousStepGoesHere" SetScript = { $current = Get-WebConfiguration /system.webServer/security/ipSecurity -Metadata | select -ExpandProperty metadata | select -ExpandProperty effectiveOverrideMode $expected = "Allow" $incorrect = $current -ne $expected if ($incorrect) { try { Start-WebCommitDelay Set-WebConfiguration /system.webServer/security/ipSecurity -metadata overrideMode -value Allow -Verbose Stop-WebCommitDelay -Commit $true } catch [System.Exception] { $_ | Out-String } } } TestScript = { $current = Get-WebConfiguration /system.webServer/security/ipSecurity -Metadata | select -ExpandProperty metadata | select -ExpandProperty effectiveOverrideMode $expected = "Allow" $result = $current -eq $expected return $result } GetScript = { $current = Get-WebConfiguration /system.webServer/security/ipSecurity -Metadata | select -ExpandProperty metadata | select -ExpandProperty effectiveOverrideMode $settings = @{ "ipSecurity" = $currentIpSecurity } return $settings } }