[英]How to set IP Address Restrictions for Management Service in IIS through PowerShell?
I'm looking for a way to script the whole IIS configuration through PowerShell and I've already done most of it.我正在寻找一种通过 PowerShell 编写整个 IIS 配置脚本的方法,并且我已经完成了大部分工作。 The problem I'm facing right now is how to set ' IP Address Restrictions ' for Management Service in IIS.
我现在面临的问题是如何为 IIS 中的管理服务设置“ IP 地址限制”。 I know there is a simple way to do it for a domain or a site but my goal is to limit the number of IP's being able to deploy to IIS.
我知道对于域或站点有一种简单的方法,但我的目标是限制能够部署到 IIS 的 IP 数量。
Including screenshot for clarification: IIS Management Service包括澄清截图: IIS 管理服务
Following @BruceZhang advice, I've firstly set up the required value using the UI, then looked up the registry 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WebManagement\Server\RemoteRestrictions' and found out the encrypted value for my ip address.根据@BruceZhang 的建议,我首先使用 UI 设置了所需的值,然后查找注册表“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WebManagement\Server\RemoteRestrictions”并找到了我的 ip 地址的加密值。 From now on setting it up was only a matter of changing the value for this key in the registry through PowerShell script.
从现在开始,只需通过 PowerShell 脚本更改注册表中此键的值即可进行设置。 It works fine, thanks!
它工作正常,谢谢!
Stop-Service -Name "WMSVC"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WebManagement\Server" -Name "RemoteRestrictions" -Value /wEZAgAAAAEAAABnAgAAABkBAAAAAAAAABkDAAAAAQAAAC4EA8ADqAMdAx0CAAAALgQD/wP/A/8D/wMAAAB
Start-Service -Name "WMSVC"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.