Exchange Online Powershell not connecting in scheduled Task script
Hello everyone,
I am having this issue where I can’t find any useful answer.
We are connecting to Exchange Online with certificate based authentication and it works fine when we run the script manually.
Running the script via scheduled task with the same user, we always receive the following error messages.
PS>TerminatingError(Get-ConnectionContext): “One or more errors occurred.”
PS>TerminatingError(): “An error occurred while sending the request.”
An error occurred while sending the request.
At C:Program FilesWindowsPowerShellModulesExchangeOnlineManagement3.5.0netFrameworkExchange
OnlineManagement.psm1:762 char:21
+ throw $_.Exception.InnerException;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], HttpRequestException
+ FullyQualifiedErrorId : An error occurred while sending the request.
This is the command we use to connect:
Connect-ExchangeOnline -AppId $AppId -CertificateThumbprint $CertificateThumbprint -Organization $Organization -ShowBanner:$false -loglevel all
Has anyone experienced this before?
ExchangeOnlineManagement Module is Version 3.5.0
Powershell Version is 5.1.14393.7155
Hello everyone, I am having this issue where I can’t find any useful answer.We are connecting to Exchange Online with certificate based authentication and it works fine when we run the script manually.Running the script via scheduled task with the same user, we always receive the following error messages. PS>TerminatingError(Get-ConnectionContext): “One or more errors occurred.”
PS>TerminatingError(): “An error occurred while sending the request.”
An error occurred while sending the request.
At C:Program FilesWindowsPowerShellModulesExchangeOnlineManagement3.5.0netFrameworkExchange
OnlineManagement.psm1:762 char:21
+ throw $_.Exception.InnerException;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], HttpRequestException
+ FullyQualifiedErrorId : An error occurred while sending the request. This is the command we use to connect: Connect-ExchangeOnline -AppId $AppId -CertificateThumbprint $CertificateThumbprint -Organization $Organization -ShowBanner:$false -loglevel all Has anyone experienced this before? ExchangeOnlineManagement Module is Version 3.5.0Powershell Version is 5.1.14393.7155 Read More