Created
February 26, 2014 15:34
-
-
Save ifrahim/9231734 to your computer and use it in GitHub Desktop.
IP Restrict an IIS website using Powershell
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
# Restrict IIS website to be only accessible locally. | |
$SiteName = "MySiteName" | |
# secure site - Restrict IP | |
Set-WebConfigurationProperty -Filter /system.webserver/security/ipsecurity -Name allowUnlisted -Value $false -Location $SiteName | |
add-webconfiguration /system.webServer/security/ipSecurity -location $SiteName -value @{ipAddress="localhost";allowed="true"} -pspath IIS:\ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment