使用winrm和Microsoft.Update.Session远程修补服务器时出现问题
我有一个与Windows 2003,2008和2008r2服务器的networking。 我有一个PowerShell脚本,我写了使用“Microsoft.Update”COM对象修补本地机器。 (类似于Windows Update PowerShell Remoting 。)我的脚本在本地非常有效,但是我想远程使用它的function,因为我有相当数量的服务器来pipe理。 在这种情况下,这种情况就会下降(类似于另一个没有解决的情况)。 然而,我却能够把失败的范围缩小到特定class级的两种方法。 (New-Object -ComObject "Microsoft.Update.Session").CreateUpdateDownloader() (New-Object -ComObject "Microsoft.Update.Session").CreateUpdateInstaller() 如果您以pipe理员身份在本地运行这些PowerShell,则不会有任何问题。 如果您尝试使用invoke-command(或enter-session或winrs),则会出现以下错误。 (这是使用本地主机进行testing,但任何主机都可以,我也尝试了不同的authentication方法,例如:credssp和Kerberos。 PS C:\> Invoke-Command -ComputerName localhost -ScriptBlock { (New-Object -ComObject "microsoft.update.session").createUpdateDownloader()} Exception calling "CreateUpdateDownloader" with "0" argument(s): "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : ComMethodTargetInvocation 我曾经在博客中看到过这个bug,但没有对这个声明做任何备份。 […]