Monday, July 22, 2013

Quick Script:Enable automatic updates with default values with Powershell


#Enable Auto Updates with default schedule
    $objAutoUpdate = new-Object -com Microsoft.Update.AutoUpdate
    $objSettings = $objAutoUpdate.Settings

    $objSettings.NotificationLevel = 4
    $objSettings.IncludeRecommendedUpdates = $true
    $objSettings.Save()
       Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" -Name ScheduledInstallTime -Value 4

No comments: