appcmd cmd 操作IIS

创建子站点

appcmd.exe add app /site.name:"Default Web Site" /path:/TestSite /physicalPath:"C:Applications"

打开C:WindowsSystem32inetsrvconfigapplicationHost.config配置,添加下面的配置

<location path="Default Web Site/TestSite">
<system.webServer>
<security>
<authentication>
<windowsAuthentication enabled="true" />
<anonymousAuthentication enabled="false" />
</authentication>
</security>
</system.webServer>
</location>

原文地址:https://www.cnblogs.com/lizhanglong/p/10992145.html