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 for business | Windows Server | Devices and deployment | Set up, install, or upgrade
Windows for business | Windows Server | User experience | Other
Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 44,766 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 10,356 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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.