我看到了一些相关的问题,但没有一个解决方案对我不起作用。我有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。
这是用于Windows Update的reg键的full list以供参考,但如果将HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate
设置为1
,则会禁用Windows Update。
您可以使用New-ItemProperty使用PowerShell设置此值