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

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

问题描述

我编写了一个脚本来使用 Microsoft.Update.Session COM 对象在计算机上搜索/下载/安装 Windows 更新.在本地运行时它工作得很好,但是当通过远程会话或通过调用命令运行时,我在 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 更新,可以找到 这里.

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天全站免登陆