我知道如何通过名称引用站点来停止和启动它吗?例如:
appcmd stop site /site.name:"Microsoft SharePoint Administration"
如何使用 IIS ID 引用网站?我尝试了这些变体:
appcmd start stop /site.id:2
appcmd start stop /site.id:"2"
appcmd start stop /site.id:2
appcmd start site /section:sites /[id='2']
但是它们都返回以下错误:
ERROR ( message:Must specify the SITE object with identifier. )
最佳答案
看起来它不受支持。您可以提供站点名称或 URL,但不能提供站点 ID。
C:\Windows\System32\inetsrv>appcmd 停止站点/? 停止虚拟站点
APPCMD 停止 SITE <-parameter1:value1 ...>
停止指定的虚拟站点,并阻止新的请求 在其绑定(bind)端点上收到。必须提供准确的网站标识符 并且必须解析为现有站点。
支持的参数:
标识符(必需)
Site name or url of the site to stop
/站点名称
Site name or url of the site to stop (same as identifier)
关于iis - 如何使用 IIS7 APPCMD 按 ID 引用站点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1367960/