Error : Getting error "Exception from HRESULT: 0x80240440" after running command "$updateSession = new-object -com "Microsoft.Update.Session"; $updates=$updateSession.CreateupdateSearcher().Search($criteria).Updates"

Rajiv Kalra 0 Reputation points
2023-09-20T19:16:09.6533333+00:00

Hi All,

Issue is my machine is not visible in WSUS console and while doing troubleshooting I found this error when i run update session command

$updateSession = new-object -com "Microsoft.Update.Session"; $updates=$updateSession.CreateupdateSearcher().Search($criteria).Update

PS C:\Windows\system32> $updateSession = new-object -com "Microsoft.Update.Session"; $updates=$updateSession.CreateupdateSearcher().Search($criteria).Updates
Exception from HRESULT: 0x80240440
At line:1 char:62
+ ... e.Session"; $updates=$updateSession.CreateupdateSearcher().Search($cr ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,997 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,511 questions
Windows Server Management
Windows Server Management
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Management: The act or process of organizing, handling, directing or controlling something.
424 questions
Windows Server Infrastructure
Windows Server Infrastructure
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Infrastructure: A Microsoft solution area focused on providing organizations with a cloud solution that supports their real-world needs and meets evolving regulatory requirements.
526 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 44,091 Reputation points
    2023-09-21T13:49:55.7166667+00:00

    Hello Rajiv Kalra,

    Since you have already completed some troubleshooting without success, I would suspect 2 reasons:

    1. Network connection: Ensure that there is no Firewall blocking the connection to Windows Update, or in case, that there is a proxy configuration that is affecting the external connection to internet resources.
    2. Perform a Clean Boot to discard 3rd Party apps or services interfering:
    1. Reset Windows Update components based on the next Microsoft Official article:

    https://learn.microsoft.com/en-us/troubleshoot/windows-client/deployment/additional-resources-for-windows-update

    1. Perform a DISM health check and repair: https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/repair-a-windows-image?view=windows-11

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

  2. Adam J. Marshall 9,041 Reputation points MVP
    2023-10-04T17:03:59.89+00:00

    If your systems are not visible in WSUS, the issue lies with either the GPOs or the WSUS server.

    https://www.ajtek.ca/wsus/client-machines-not-reporting-to-wsus-properly/

    Run through the troubleshooting steps as you already seemed to have run the client side script.

    Part 4 of my guide deals with the policies and part 5 the linking of the GPOs for an inheritance setup.

    https://www.ajtek.ca/wsus/how-to-setup-manage-and-maintain-wsus-part-4-creating-your-gpos-for-an-inheritance-setup/

    0 comments No comments