PowerShell Exchange Exception – Cannot bind argument to parameter ‘TokenProvider’ because it is null

We have upgraded the Exchange Online Management PowerShell Module to newer version (2.0.3).

Install-Module -Name ExchangeOnlineManagement -RequiredVersion 2.0.3

After upgrade some of our solutions started giving below errors:

Exception calling “GetSteppablePipeline” with “1” argument(s): “Cannot bind argument to parameter ‘TokenProvider’ because it is null.”

On researching, We have found that this is only happening in scripts where we are connecting to both Exchange Onpremise as well as Exchange Online.

LaunchEXOnprem -ComputerName Exchange1.labtest.com

LaunchEOL -Appid $EXOClientID -CertificateThumbprint $ThumbPrint -Organization $TenantName

On doing, more troubleshooting and research on internet we have found the easy fix, just by changing the order in which we connect will fix it.

Call Exchange Online First and then Call exchange onpremise will resolve this error.

LaunchEOL -Appid $EXOClientID -CertificateThumbprint $ThumbPrint -Organization $TenantName

LaunchEXOnprem -ComputerName Exchange1.labtest.com

I hope this quick TIP will assist you and save your troubleshooting time if you are in same kind of scenario.



Thanks for reading …

Tech Wizard



PowerShell Fast Track

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s