Forum Discussion

ColeRiese's avatar
ColeRiese
Copper Contributor
Apr 14, 2023

PowerShell - ActiveX Control Error

Greetings,

We have a script that connects to Exchange Online. The first time we run the script, it kicks back this error: "ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment." However, if we run the script a 2nd time, it works fine. What could be causing this? And how do I fix the script so that we don't have to keep running it twice?

Thanks,

Cole Riese

Resources