Remove Ip From Ip and domain restriction through powershell

社会主义新天地 提交于 2019-12-24 12:40:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!