gpt4 book ai didi

iis - 在将绑定(bind)添加到网站之前,APPCMD 如何测试绑定(bind)是否存在?

转载 作者:行者123 更新时间:2023-12-04 16:09:14 26 4
gpt4 key购买 nike

我们在部署脚本中使用 appcmd 来设置服务器,我需要确保将绑定(bind)添加到现有站点不会引发错误

C:\Windows\System32\inetsrv\appcmd.exe set site /site.name:"abc.com" 
/+bindings. [protocol='http',bindingInformation='*:80:alias-abc.com']

工作,但在下一个脚本运行我得到错误..

无法添加类型为“绑定(bind)”的重复集合条目,组合键属性“协议(protocol),绑定(bind)信息”分别设置为“
http, *:alias-abc.com'


有没有办法在将绑定(bind)添加到 appcmd 之前检查绑定(bind)是否存在

(不允许使用 powershell - 所以必须是 appcmd 或其他命令行 exe)

谢谢

最佳答案

appcmd 在搜索部门有点缺乏,但这样的事情应该可以工作:

C:\Windows\system32\inetsrv\appcmd.exe list site "abc.com" | findstr bindings:http/*:80

关于iis - 在将绑定(bind)添加到网站之前,APPCMD 如何测试绑定(bind)是否存在?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26417576/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com