Schedule Task | Reading email from Outlook | 80080005 Server execution failed

Welcome Forums General PowerShell Q&A Schedule Task | Reading email from Outlook | 80080005 Server execution failed

Viewing 1 reply thread
  • Author
    Posts
    • #231868
      Participant
      Topics: 1
      Replies: 0
      Points: 15
      Rank: Member

      Hi All,

      I am trying to read emails via ps script from outlook and it works fine (without any pop-up).

      I have configured a schedule task to run as my user and trying to run the same script but it fails with error:

      TerminatingError(New-Object): “Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).”
      New-Object : Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed
      due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005
      (CO_E_SERVER_EXEC_FAILURE)).

      + $Outlook = New-Object -comobject Outlook.Application
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : ResourceUnavailable: (:) [New-Object], COMException
      + FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand
      New-Object : Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed
      due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005
      (CO_E_SERVER_EXEC_FAILURE)).

      I have added logging functionality to my script to confirm that the schedule task is running my under context and not the system context.

      My goal is to create schedule task, which retrieves emails from outlook and create custom email alerts.

      Any help with the above error or suggestion about any other method/strategy would be highly appreciated.

    • #231898
      Participant
      Topics: 0
      Replies: 30
      Points: 284
      Helping Hand
      Rank: Contributor
Viewing 1 reply thread
  • You must be logged in to reply to this topic.