简体   繁体   English

如何在 IIS 到 PowerShell 中设置管理服务的 IP 地址限制?

[英]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.

相关问题 通过Powershell在IIS中进行IP地址和域限制 - IP address and domain restrictions in iis through powershell 使用 PowerShell 设置 IP 地址和域限制 - Setting IP address and domain restrictions using PowerShell 如何通过Powershell脚本设置IIS 10.0管理服务SSL证书以允许Web部署? - How do I set the IIS 10.0 Management Service SSL Certificate via a Powershell script to allow Web Deploy? 如何使用 Powershell 7 将保留的 IP 地址分配给 Azure 上的云服务? - How to assign a reserved IP address to a cloud service on Azure using Powershell 7? 如何通过Powershell设置IIS网站的物理路径凭据? - How to set an IIS Website's Physical Path credentials through Powershell? 如何使用PowerShell 1.0更改IIS6中所有站点的IP地址? - How can I change the IP address of all sites in IIS6 using powershell 1.0? Windows Powershell在网络适配器上设置IP地址 - Windows Powershell Set IP Address on network adapter IIS 7.5 Powershell脚本-管理服务和配置Web部署发布 - IIS 7.5 Powershell script - Management service & Configure Web Deploy Publishing 通过 PowerShell 在 IIS 中设置应用程序设置 - Set application settings in IIS through PowerShell 如何通过Powershell获取与Azure App Service关联的虚拟IP地址 - How to get the Virtual IP Address associated with a Azure App Service via Powershell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM