使用Powershell禁用自动更新(2012R2)

Noa*_*oam 5 powershell windows-server-2012-r2

我看到了一些相关的问题,但是所有解决方案都不适合我。我有Windows Server 2012R2,我需要使用Powershell v5.0或批处理(首选Powershell)禁用它的自动Windows更新。

我可以通过以下方式手动进行操作:打开gpedit.msc,导航至Computer Configuration -> Administrative Templates -> Windows Components -> Windows Update,然后更改Configure Automatic UpdatesDisable

使用外部Powershell模块(例如PolicyFileEditor)如何自动完成操作。

是否存在等效的注册表项,可以对其进行更改以完成工作?我知道Windows Server 2008有一个,但是我正在使用2012R2。

Jam*_* C. 7

这是供参考的 Windows 更新注册表项的完整列表,但如果您设置HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate1此项,则会禁用 Windows 更新。

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