Windows – Microsoft.Update.AutoUpdate or Powershell query reporting incorrect NotificationLevel

powershellwindowswindows-update

If I use Sconfig > 5) Windows Update Settings shows as 'Manual'

But when I run the following query in powershell:

(New-Object -ComObject "Microsoft.Update.AutoUpdate").Settings

It says the NotificationLevel = 4, which means Install updates automatically (4)

My RegTree for windows updates looks like this:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
REG_DWORD: NoAutoUpdate: 1

I have also tried:

PS C:\Users\Administrator> $WUSettings = (New-Object -com "Microsoft.Update.AutoUpdate").Settings
PS C:\Users\Administrator> $WUSettings.NotificationLevel=1
PS C:\Users\Administrator> $WUSettings.save()
PS C:\Users\Administrator> (New-Object -com "Microsoft.Update.AutoUpdate").Settings


NotificationLevel         : 4
ReadOnly                  : False
Required                  : True
ScheduledInstallationDay  : 0
ScheduledInstallationTime : 3
IncludeRecommendedUpdates : True
NonAdministratorsElevated : True
FeaturedUpdatesEnabled    : False

But as you can see, it still reports NotificationLevel=4
My questions are:

  1. How do I find out which method is telling me the wrong information?
  2. Why is it telling me the wrong information?
  3. How do I fix this?

Best Answer

The IAutomaticUpdates::Settings properties you're reading are telling you what Windows Update itself thinks the settings are. So that's the most reliable source of information.

Modifying the IAutomaticUpdates::Settings::NotificationLevel setting is not supported in Windows 10. For unfortunately-necessary application compatibility reasons, IAutomaticUpdates::Settings::Save will "succeed" but will not actually modify that setting. See https://docs.microsoft.com/en-us/windows/win32/api/wuapi/nf-wuapi-iautomaticupdatessettings-get_notificationlevel .

The most probable cause for the behavior you're seeing is that you're trying to configure Windows Update settings on a PC running Windows 10 Home (or one of the 'starter' SKUs in some markets). These SKUs do not support changing the NotificationLevel. Windows 10 SKUs with management capabilities, like the Professional and Enterprise SKUs, allow Automatic Updates settings to be configured through Group Policy or Mobile Device Management.