如何将Windows Update设置为从不使用PowerShell检查更新?

我正在寻找Power Shell,Windows Server 2008 R2的帮助脚本,因此Windows更新设置为“从不检查更新”.我找到了一些接近的答案,但我仍然不能做我想要的.目前,我必须通过单击Windows Update>来设置它.更改设置>从不检查更新.提前致谢.
您可以使用COM对象:
$WUSettings = (New-Object -com "Microsoft.Update.AutoUpdate").Settings
$WUSettings
NotificationLevel         : 2
ReadOnly                  : True
required                  : False
ScheduledInstallationDay  : 0
ScheduledInstallationTime : 3
IncludeRecommendedUpdates : True
NonAdministratorsElevated : True
FeaturedUpdatesEnabled    : True

用:

NotificationLevel  :
0 = Not configured;
1 = disabled;
2 = Notify before download;
3 = Notify before installation;
4 = Scheduled installation;

你可以测试:

$WUSettings = (New-Object -com "Microsoft.Update.AutoUpdate").Settings
$WUSettings.NotificationLevel=1
$WUSettings.save()

(编辑)的

您必须在提升模式下以管理员身份运行PowerShell会话.

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...