gpt4 book ai didi

powershell - 使用Powershell创建IIS 6.0应用程序池

转载 作者:行者123 更新时间:2023-12-04 13:35:59 24 4
gpt4 key购买 nike

如何使用PowerShell脚本在IIS 6.0上创建应用程序池?

到目前为止,这是我想出的...

$appPool = [wmiclass] "root\MicrosoftIISv2:IIsApplicationPool"

谢谢

最佳答案

这不是最明显的过程,但这对我有用。

$AppPoolSettings = [wmiclass]'root\MicrosoftIISv2:IISApplicationPoolSetting'
$NewPool = $AppPoolSettings.CreateInstance()
$NewPool.Name = 'W3SVC/AppPools/MyAppPool'
$Result = $NewPool.Put()

调用Put()可能会出错,但是第二(或第三次)调用应该可以使它工作。这是由于PowerShell V1和WMI存在问题。

关于powershell - 使用Powershell创建IIS 6.0应用程序池,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/261237/

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