【问题标题】:Disable automatic updates (2012R2) with powershell使用 powershell 禁用自动更新 (2012R2)
【发布时间】:2018-01-02 09:41:21
【问题描述】:

我看到了一些相关的问题,但没有一个解决方案对我不起作用。 我有 windows server 2012R2,我需要使用 Powershell v5.0 或批处理禁用它的自动 windows 更新(首选 Powershell)。

我可以手动完成,打开gpedit.msc,导航到Computer Configuration -> Administrative Templates -> Windows Components -> Windows Update,然后将Configure Automatic Updates更改为Disable

如何在使用外部 powershell 模块(例如PolicyFileEditor)的情况下自动完成。

是否有等效的注册表项可以更改它来完成工作?我知道有一个适用于 Windows server 2008 但我使用的是 2012R2。

【问题讨论】:

    标签: powershell windows-server-2012-r2


    【解决方案1】:

    这是供 Windows 更新参考的 reg 键的 full list,但如果您将 HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate 设置为 1,这将禁用 Windows 更新。

    您可以使用New-ItemProperty 使用 PowerShell 设置此值

    【讨论】:

    • 谢谢,密钥不存在,所以我必须创建它,然后它就起作用了。
    • 我的 Windows 2012 R2 中没有这样的键。能否告诉我们它的类型并提供 .reg 文件的来源以关闭设置?
    • 我刚刚通过编辑您的答案而不是创建新答案添加了regedit 示例。希望你不要介意。
    • 请将其添加为您自己的答案 - 我的答案是 PowerShell,与创建 reg 文件不同。
    猜你喜欢
    • 1970-01-01
    • 2019-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-25
    • 1970-01-01
    • 2017-11-17
    相关资源
    最近更新 更多