不确定哪些错误!我在Windows 7上使用PowerShell 2.0。如果这个脚本在Windows XP上工作,我只是想念一些东西?重新启动IIS6应用程序池 - ADSI错误
$server = "server1-vm1.prod.ds.russell.com"
$name = "Superduper_Reports"
$iis = [ADSI]"IIS://$server/W3SVC/AppPools/$name"
$iis.psbase.invoke("recycle")
错误(即调用看起来不错给我吗?):
Exception calling "Invoke" with "2" argument(s): "Unknown error (0x80005000)"
At line:3 char:19
+ $iis.psbase.invoke <<<< ("recycle")
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
如果只是运行$iis
可变我得到这个错误:
The following exception occurred while retrieving member "PSComputerName": "Unknown error (0x80005000)"
+ CategoryInfo : NotSpecified: (:) [format-default], ExtendedTypeSystemException
+ FullyQualifiedErrorId : CatchFromBaseGetMember,Microsoft.PowerShell.Commands.FormatDefaultCommand
Roooarr!我宁愿使用WMI上的ADSI!任何帮助? :)
谢谢!你介意修复你的代码中的错字吗?将d添加到Get-ChildItem IIS: – 2014-03-27 18:00:17