2012-03-08 3 views
8

PowerShell, Windows Server 2008 R2에서 도움말 스크립팅을 찾고 있으므로 Windows Updates가 "업데이트를 확인하지 않음"으로 설정되어 있습니다. 가까운 답변을 찾았지만 여전히 원하는 것을 할 수 없습니다. 현재 Windows Update> 설정 변경> 업데이트 확인 안 함을 클릭하여 설정해야합니다. 미리 감사드립니다.PowerShell로 업데이트를 확인하지 않도록 Windows Update를 설정하는 방법은 무엇입니까?

$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 

으로 :

답변

11

당신은 그것에 대해 COM 개체 사용할 수 있습니다

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 세션을 사용해야합니다.

+0

대단히 감사합니다. – user1256194

관련 문제