Skip to content

Instantly share code, notes, and snippets.

@ctigeek
Created July 26, 2017 16:02
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 ctigeek/4a96a5bc31c65dcb569214966b937443 to your computer and use it in GitHub Desktop.
Save ctigeek/4a96a5bc31c65dcb569214966b937443 to your computer and use it in GitHub Desktop.
Enable proxy mode in the IP security settings in IIS.
function Enable-IpSecurityProxyMode($websiteName) {
Add-Type -Path "$env:SystemRoot\System32\inetsrv\Microsoft.Web.Administration.dll"
$manager = New-Object Microsoft.Web.Administration.ServerManager
$config = $manager.GetApplicationHostConfiguration();
$cpSecConfig = $config.GetSection("system.webServer/security/ipSecurity", $websiteName)
$cpSecConfig.SetAttributeValue("enableProxyMode",$true)
$manager.CommitChanges();
$manager.Dispose()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment