Powershell を使用して Web サイトの IP 制限を追加/削除/編集する Powershell スクリプトを作成しています。これまでのところ、制限を追加することはできますが、既存の IP 制限を編集する最良の方法を知りたい.
追加
Add-WebConfiguration -Filter /system.webserver/security/ipsecurity -Value @{ipAddress=$ipAddress;subnetMask="255.255.255.255";allowed=$allowed} -Location $websiteName -PSPath "IIS:\"
編集
次のさまざまな組み合わせを試しました。
Set-WebConfiguration -Filter system.webServer/security/ipSecurity/add[@ipAddress='192.123.123.123'] -Name "ipAddress" -Value $ipAddress -Location $websiteName -PSPath "IIS:\"
Set-WebConfigurationProperty -Filter system.webServer/security/ipSecurity/add[@ipAddress='192.123.123.123'] -Value = @{ipAddress=$ipAddress;subnetMask="255.255.255.255";allowed=$allowed} -Location $websiteName -PSPath "IIS:\"
基本的にすべてをクリアし、毎回再作成するのが最善の方法ですか?