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

问题描述 投票:3回答:1

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

我可以通过打开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个回答
2
投票

这是用于Windows Update的reg键的full list以供参考,但如果将HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate设置为1,则会禁用Windows Update。

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

© www.soinside.com 2019 - 2024. All rights reserved.