使用 C# 远程使用 WUA
我正在尝试连接到远程计算机并确定是否有任何要使用 C# 和 WUApiLib 安装的 Windows 更新。这看起来很简单,但是我不知道如何实际连接到远程计算机。
http://msdn.microsoft.com/en- us/library/aa387288(v=VS.85).aspx 标识可以远程使用,除了一些我不关心的例外,但似乎没有关于如何使用的文档实际上连接。我尝试传递计算机名称,但这效果不佳(传递包含乱码“成功”的名称与不传递任何内容相同,并且导致相同的计数,因此我假设该字符串未使用。)
var updateSession = new UpdateSession(dependencies.ComputerName);
var searcher = updateSession.CreateUpdateSearcher();
var results = searcher.Search("IsInstalled=0 and Type='Software'");
有谁知道谁在做通过 C# 远程使用 WUA?
I am trying to connect to a remote machine and determine if there are any Windows Updates to be installed using C# and WUApiLib. It seems pretty straightforward, however I cannot find out how to actually connect to the remote computer.
http://msdn.microsoft.com/en-us/library/aa387288(v=VS.85).aspx identifies that is can be used remotely, with a few exception that I am not concerned about, but there seems to be no documentation on how to actually connect. I tried passing in a computer name, but this did not work as well (passing a name containing gibberish "succeeds" the same as passing nothing, and results in the same counts so I assume that string is unused.)
var updateSession = new UpdateSession(dependencies.ComputerName);
var searcher = updateSession.CreateUpdateSearcher();
var results = searcher.Search("IsInstalled=0 and Type='Software'");
Does anyone know who do use WUA remotely via C#?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
几年前我一直在寻找同样的东西并写了一个小脚本。
I was looking for the same thing years ago and wrote a little script.
试试这个:
Try this: