![](/img/trans.png)
[英]How do I install “Important” Windows Updates remotely using Powershell?
[英]How do I set Windows Update to never check for updates with PowerShell?
我正在尋找PowerShell,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會話。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.