Powershell远程:Microsoft.Update.Session,访问被拒绝:0x80070005 [英] Powershell Remote: Microsoft.Update.Session, Access Denied: 0x80070005

查看:157
本文介绍了Powershell远程:Microsoft.Update.Session,访问被拒绝:0x80070005的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个脚本,使用Microsoft.Update.Session COM对象在计算机上搜索/下载/安装Windows Update。在本地运行时,它可以正常工作,但是在通过远程会话或通过Invoke-Command运行时,我在Microsoft.Update.Session.CreateUpdateDownloader()上收到拒绝访问(0x80070005)错误

I've written a script to search/download/install Windows Updates on a machine using the Microsoft.Update.Session COM Object. When run locally it works just fine, however when running through a remote session or through Invoke-Command I receive an access denied (0x80070005) error on Microsoft.Update.Session.CreateUpdateDownloader()

如果我尝试直接创建一个Downloader对象,并收到代码以重现此问题,则会收到相同的错误:

I receive the same error if I attempt to create a Downloader object directly, code to reproduce the issue:

$oUpdateDownloader = new-object -com "Microsoft.Update.Downloader" 

我是远程管理员计算机,并将凭据(对于我本人或任何其他管理员帐户)传递给计算机似乎没有任何更改。

I am an administrator on the remote machine, and passing credentials (for myself explicitly or any other admin account) to the machine does not seem to change anything.

我已经看到此错误了,时间,但似乎没有解决此问题的任何信息...

I've seen this error posted a number of times but there does not seem to be any information on solving the problem...

有什么想法吗?

推荐答案

这是一个已知问题。似乎实际的COM对象本身存在错误,因为使用VBScript,PowerShell甚至C#时会发生此问题。有一篇很好的文章讨论了如何使用PowerShell管理Windows Update,该文章此处

This is a known issue. It appears that there is a bug with the actual COM object itself, as this issue occurs when using VBScript, PowerShell, and even C#. There is a good article that discusses managing Windows Update with PowerShell that can be found here.

解决方法是在计算机上设置计划任务,您可以根据需要调用该任务。

The workaround is to set up a scheduled task on the computer and you can invoke that task however you see fit.

这篇关于Powershell远程:Microsoft.Update.Session,访问被拒绝:0x80070005的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆