获取非管理员帐户的IIS应用程序池WMI对象
我编写了一个PowerShell脚本来停止和启动Windows Server 2008计算机上的IIS应用程序池。 IIS版本是7.5获取非管理员帐户的IIS应用程序池WMI对象
我在机器上拥有管理员权限,当我运行它时,脚本工作正常。但是,当我使用非管理员服务帐户触发相同的脚本时,它将失败。
触发器来自CA Release Automation工具,代理程序在机器上使用服务帐户进行配置。以下是我卡住的命令。
gwmi -Namespace root\webAdministration -class ApplicationPool -Authentication PacketPrivacy | Where-Object { $_.Name -eq "siteURL" }
错误:
*****Get-WmiObject : Provider load failure At C:\Users\SVC_DEV_APP\AppData\Local\Temp\tempz_891958570065876740601304.ps1:2 char:5
+ gwmi <<<< -Namespace root\webAdministration -class ApplicationPool
+ CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand Get-WmiObject : Provider load failure At C:\Users\SVC_DEV_APP\AppData\Local\Temp\tempz_891958570065876740601304.ps1:2 char:5
+ gwmi <<<< -Namespace root\webAdministration -class ApplicationPool + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand*****
我试图让其他Windows服务(win32_service时)WMI对象,它工作正常。只有IIS对象会抛出错误。
我已经在命名空间(实际上是Root和它的子命名空间)上给出了服务帐户,控制(Execute方法,启用帐户,远程启用),如某些论坛中所建议的。
我也将该服务帐户添加为IIS管理器,但没有任何结果。