IP address and domain restrictions in iis through powershell

.net, iis, powershell, security, windows

Solution

EDIT: This code will toggle Access for unspecified clients value so it is correct in that respect. Use it without -PSPath and it will work

Set-WebConfigurationProperty /system.webserver/security/ipsecurity -Name allowUnlisted -Value "true" -Location "IIS:\Sites\123"

Problem

I am very new in `powershell`. How to change `ip address and domain restrictions` in IIS through `powershell`. Here is the screen shot how we can manualy do this from IIS. Currently I am using this code to change the settings. `Set-WebConfigurationProperty /system.webserver/security/ipsecurity -Name allowUnlisted -Value "true" -Location "IIS:\Sites\123" -pspath IIS:\Sites\123` Don't know this is correct or not. Please help.

Original source