Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object reference not set to an instance of an object. #21

Open
gen2k1 opened this issue May 18, 2024 · 13 comments
Open

Object reference not set to an instance of an object. #21

gen2k1 opened this issue May 18, 2024 · 13 comments

Comments

@gen2k1
Copy link

gen2k1 commented May 18, 2024

Since several weeks I am not able anymore to install new updates. It always fails with the error: 'Object reference not set to an instance of an object'.
Does anyone know how to fix this. I have uninstalled and reinstalled PSWindowsUpdate but without success.

As an example todays full verbose output is:

VERBOSE: PC (18.05.2024 09:37:48): Connecting to Microsoft Update server. Please wait...
VERBOSE: Found [1] Updates in pre search criteria
VERBOSE: Found [1] Updates in post search criteria
Get-WindowsUpdate: Something goes wrong: Cumulative Update for Windows 11 Insider Preview (10.0.22635.3640) (KB5037867); Object reference not set to an instance of an object.
Get-WindowsUpdate: Something goes wrong: Cumulative Update for Windows 11 Insider Preview (10.0.22635.3640) (KB5037867); Object reference not set to an instance of an object.

X ComputerName Result KB Size Title


VERBOSE: Accepted [0] Updates ready to Download
VERBOSE: Downloaded [0] Updates ready to Install
VERBOSE: Installed [0] Updates

@GKilsgaard
Copy link

I have the exact same problem
image

@gcapnias
Copy link

gcapnias commented Jul 3, 2024

Ditto...

@bilemke
Copy link

bilemke commented Jul 4, 2024

Hmm. Ran into errors today mentioning the same "Object reference not set to an instance of an object."

Before I found this GitHub issue, I found a forum post on AskWoody.com from April 2023 that may be related as well..
https://www.askwoody.com/forums/topic/updating-causing-problems-again/

I commented there as well (but post is "Awaiting Moderation")... Based on the OP's post there and some feedback from a Guest user later in the thread, I discovered something with recent versions (not sure how far back it goes)..

Although there are settings in the following registry key (and/or subkeys) that can exist without configuring the use of a WSUS server, it appears that at least Get-WUSettings from PSWIndowsUpdate results in the above error if any configuration values are present in the key/subkeys if "UseWUServer" is not configured one way or the other (0 - NotUse WSUS, 1- Use WSUS)..

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate

I had one or more settings configured already via registry/ADMX/GPO at the above location, but had not configured the setting defining if a WSUS server should be used or not.

The moment i created:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
UseWUServer

and set it to either 0 or 1, no more "Object reference not set to an instance of an object." errror.

@igorakkerman
Copy link

Same issue in my update script for always the same KB id: KB2267602
I installed the update manually, the error went away.
The next day, the error re-appeared.

@bilemke I don't have that registry key at all: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate

My script output:

Line |
 172 |      Get-WindowsUpdate -Install -AcceptAll
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Something goes wrong: Security Intelligence-Update für Microsoft Defender Antivirus – KB2267602 (Version 1.413.720.0) – Aktueller Kanal (Allgemein); Object reference not set to an instance of an object.
Get-WindowsUpdate: C:\system-config\system-update-core.ps1:172
Line |
 172 |      Get-WindowsUpdate -Install -AcceptAll
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Something goes wrong: Security Intelligence-Update für Microsoft Defender Antivirus – KB2267602 (Version 1.413.720.0) – Aktueller Kanal (Allgemein); Object reference not set to an instance of an object.

@thedoctorjtd
Copy link

thedoctorjtd commented Jul 10, 2024

Same here.

VERBOSE: Found [3] Updates in post search criteria
Get-WindowsUpdate: D:\Windows Locations\Documents\Scripts\updateAndShutdown.ps1:39
Line |
  39 |          Get-WindowsUpdate -AcceptAll -Install -IgnoreReboot -Verbose
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Something goes wrong: Windows Malicious Software Removal Tool x64 - v5.126 (KB890830); Object reference not set
     | to an instance of an object.
Get-WindowsUpdate: D:\Windows Locations\Documents\Scripts\updateAndShutdown.ps1:39
Line |
  39 |          Get-WindowsUpdate -AcceptAll -Install -IgnoreReboot -Verbose
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Something goes wrong: Windows Malicious Software Removal Tool x64 - v5.126 (KB890830); Object reference not set
     | to an instance of an object.
Get-WindowsUpdate: D:\Windows Locations\Documents\Scripts\updateAndShutdown.ps1:39
Line |
  39 |          Get-WindowsUpdate -AcceptAll -Install -IgnoreReboot -Verbose
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Something goes wrong: 2024-07 Cumulative Update for .NET Framework 3.5 and 4.8.1 for Windows 11, version 23H2
     | for x64 (KB5039895); Object reference not set to an instance of an object.
Get-WindowsUpdate: D:\Windows Locations\Documents\Scripts\updateAndShutdown.ps1:39
Line |
  39 |          Get-WindowsUpdate -AcceptAll -Install -IgnoreReboot -Verbose
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Something goes wrong: 2024-07 Cumulative Update for .NET Framework 3.5 and 4.8.1 for Windows 11, version 23H2
     | for x64 (KB5039895); Object reference not set to an instance of an object.
Get-WindowsUpdate: D:\Windows Locations\Documents\Scripts\updateAndShutdown.ps1:39
Line |
  39 |          Get-WindowsUpdate -AcceptAll -Install -IgnoreReboot -Verbose
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Something goes wrong: 2024-07 Cumulative Update for Windows 11 Version 23H2 for x64-based Systems (KB5040442);
     | Object reference not set to an instance of an object.
Get-WindowsUpdate: D:\Windows Locations\Documents\Scripts\updateAndShutdown.ps1:39
Line |
  39 |          Get-WindowsUpdate -AcceptAll -Install -IgnoreReboot -Verbose
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Something goes wrong: 2024-07 Cumulative Update for Windows 11 Version 23H2 for x64-based Systems (KB5040442);
     | Object reference not set to an instance of an object.
     ```

@RomboDeadfish
Copy link

I had this issue on 1 Windows 11 PC last month. Didn't affect the Windows 10 PCs at all. This month most of the Windows 11 PCs across 3 sites are doing it. The only option that I have set in the registry for this is to disable the automatic updates. I tried adding the WSUS parameter and set it to zero. Still get the same error. I tried removing the entire key and the error persists. Something that MS did most likely broke it.

PS C:\Windows\system32> Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -IgnoreReboot Install-WindowsUpdate : Something goes wrong: 2024-05 .NET 7.0.20 Security Update for x64 Client (KB5039844); Object reference not set to an instance of an object. At line:1 char:1 + Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -IgnoreReboot + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Get-WindowsUpdate], Exception + FullyQualifiedErrorId : Debug,PSWindowsUpdate.GetWindowsUpdate Install-WindowsUpdate : Something goes wrong: 2024-05 .NET 7.0.20 Security Update for x64 Client (KB5039844); Object reference not set to an instance of an object. At line:1 char:1 + Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -IgnoreReboot + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Get-WindowsUpdate], Exception + FullyQualifiedErrorId : Debug,PSWindowsUpdate.GetWindowsUpdate Install-WindowsUpdate : Something goes wrong: Windows Malicious Software Removal Tool x64 - v5.126 (KB890830); Object reference not set to an instance of an object. At line:1 char:1 + Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -IgnoreReboot + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Get-WindowsUpdate], Exception + FullyQualifiedErrorId : Debug,PSWindowsUpdate.GetWindowsUpdate Install-WindowsUpdate : Something goes wrong: Windows Malicious Software Removal Tool x64 - v5.126 (KB890830); Object reference not set to an instance of an object. At line:1 char:1 + Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -IgnoreReboot + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@braxtoon-hash
Copy link

Same problem here, any news on how to fix it ?
Your stuff didn't work for me @bilemke

@githubRover
Copy link

@braxtoon-hash Have you seen this yet? Rollback instructions from MS
#27 (comment)

@braxtoon-hash
Copy link

@braxtoon-hash Have you seen this yet? Rollback instructions from MS #27 (comment)

Thanks i'll look into that

@callworthp
Copy link

Updating PSWindowsUpdate to version 2.2.1.5 resolved the issue for me.

@ajkessel
Copy link

ajkessel commented Aug 14, 2024

I still get this issue "Object reference not set to an instance of an object" in 2.2.1.5 unless HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\WUServer exists or HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\UseWUServer is 1.

@RomboDeadfish
Copy link

Downloading and applying KB5040527 from the Microsoft Update Catalog resolves this issue.

@ajkessel
Copy link

Downloading and applying KB5040527 from the Microsoft Update Catalog resolves this issue.

Isn't that just a Win11 update? I am experiencing the problem on Win10 22H2 19045.4780.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests