Error when setting Windows Updates preferences from PowerShell

2

I tried following the suggestion here(How do I set Windows Update to never check for updates with PowerShell?), and it's very straight forward. Everything seems to be working until I get to the part where I need to actually change the NotificationLevel value. I get the following error:

Exception setting "NotificationLevel": "Exception from HRESULT: 0x80240037" At line:1 char:1 + $WUSettings.NotificationLevel=1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], SetValueInvocationException + FullyQualifiedErrorId : CatchFromBaseAdapterSetValueTI

I tried running the same sequence on another Windows 7 Pro computer and got a slightly different error message:

Exception setting "NotificationLevel": "Exception from HRESULT: 0x80240037" At line:1 char:13 + $WUSettings. <<<< NotificationLevel=1 + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : PropertyAssignmentException

The only difference that I noticed was that I'm trying to do this on Windows 7 Pro instead of Windows Server 2008 R2. This is my first venture into using PowerShell and this looked fairly simply, but I'm now quickly out of my depth. Any suggestions?

windows
powershell
asked on Stack Overflow Mar 18, 2014 by infinit_e • edited May 23, 2017 by Community

2 Answers

1

I found this in my logs from 2012 :

Can you try to remove the NoAutoUpdate key in :

HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU

Edited

I reproduce your problem, you just forget to run your PowerShell as administrator (elevated mode) :

enter image description here

versus

enter image description here

answered on Stack Overflow Mar 18, 2014 by JPBlanc • edited Mar 19, 2014 by JPBlanc
1

I had this same issue with the domain Group Policy controlling updates (Computer Configuration > Policies > Administrative Templates > Windows Components > Windows Update). It's basically the same as when the user goes to Windows Update > Change Settings and sees some elements grayed out and the message "Some settings are managed by your system administrator": when Group Policy is set, you can't change settings locally.

Solution:

  1. In that Group Policy, change all settings to "Not Configured".
  2. Run gpupdate on the local computer.
  3. Open a new administrative PowerShell prompt and try again.

Note: I did not have to change anything related to UAC.

answered on Stack Overflow Mar 11, 2015 by Mark Berry

User contributions licensed under CC BY-SA 3.0