Forum Discussion

Patrick0411's avatar
Patrick0411
Copper Contributor
Aug 07, 2024
Solved

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 m...
  • Patrick0411's avatar
    Patrick0411
    Jan 13, 2025

    It took me long time, but after creating a seperate scheduled script (only for testing Exchange Online connection), I finally found the issue.
    The new script worked fine, so it had to be something about my old script.

    As it turned out, we had a Webserver API Call executing before the ExO connect in our script and I assume the connection never closed correctly. After I removed / moved this API call, the script is working fine.
    Maybe it was blocking the same socket, which the script uses to connect to Exchange?

    Probably not really useful for you, but I hope it helps anyway.

Resources