Controlling Automatic Updates Installation Time

by Nov 3, 2011

To find out when Automatic Updates wakes your PC to install new updates, here is a script that will retrieve that information:

$updateObj = New-Object -ComObject Microsoft.Update.AutoUpdate
$day = $updateObj.Settings.ScheduledInstallationDay
$hour = $updateObj.Settings.ScheduledInstallationTime
$level = $updateObj.Settings.NotificationLevel

if ($level -eq 4) {
  if ($day -eq 0) {
    $weekday = 'every day'
  } else {
    $weekday = [System.DayOfWeek]($day-1)
  }
  
  "Automatic updates installed $weekday at $hour o'clock."
} else {
  'Updates will not be installed automatically. Check update settings for more info.'
}

To double-check settings or change them via UI, open the appropriate control like this:

$updateObj = New-Object -ComObject Microsoft.Update.AutoUpdate
$updateObj.ShowSettingsDialog()

Twitter This Tip!
ReTweet this Tip!