问题
I am able to add IP in the IIS IP and domain restriction list through powershell, but cant able to remove the IP from there.
example:
add-WebConfiguration /system.webserver/security/ipsecurity -Location "iis:\default web site" -Value @{ipaddress="192.168.1.1";allowed="true"}
How can I remove the same ip from there through powershell
回答1:
I needed the same and this is working:
Remove-WebConfigurationProperty /system.webServer/security/ipSecurity -location "iis:\default web site" -Name "." -AtElement @{ipAddress="192.168.1.1";allowed="true"} -PSPath IIS:\
回答2:
You could specify allowed = false, to effectively shut down this same rule.
add-WebConfiguration /system.webserver/security/ipsecurity -Locat "iis:\default web site" `
-Value @{ipaddress="192.168.1.1";allowed="false"}
来源:https://stackoverflow.com/questions/32331022/remove-ip-from-ip-and-domain-restriction-through-powershell