Forum Discussion

RobertCrane's avatar
Jul 08, 2020

Error when connecting to Exchange online vis PowerShell

Trying to connect to various Exchange Online tenants using the new PowerShell V2 modules and receive this error on some:

 

Import-PSSession : Data returned by the remote Get-FormatData command is not in the expected format

 

have tried both v2 module and older modules and get same result. Doesn't happen on all tenants, just a few. isn't anything to do with workstation or process as all that is run is:

 

connect-exchangeonline

 

It certainly seems to be a tenant specific issue. The standard MS support is not being helpful and just closes the ticket without providing any real solutions.

 

Did see that this seems to be an issue for some about 7 days ago but this continues to persists and results is unable to connect to Exchange Online via PowerShell to run any scripts.

 

Can someone assist??

  • Hi folks,

     

    a quick update from engineering:

    This is a known issue with only some of the service endpoints, which is why some of you are affected, some not, and why it can go away after some time.

    Engineering is working on a fix for this and will patch this as soon as possible (Since we are still narrowing it down, I can't give you a solid ETA yet, sorry), at which point everything should be back to normal. Once the problem has been resolved, I will most definitely post an update here.

     

    In the meantime, there is a workaround to get you unblocked:

    You can update the connection Uri to explicitly include the "SerializationLevel=Full" parameter.

     

    For example:

     

    Connect-ExchangeOnline

     

    would become:

     

    Connect-ExchangeOnline -ConnectionUri "https://outlook.office365.com/powershell-liveid?SerializationLevel=Full"

     

    While this will keep working indefinitely, it increases the bandwidth use, potentially slowing execution at scale. I would recommend to not use this as a permanent update to your code and undo it once the issue has been resolved.

    Note: We have received reports of this workaround not working for everybody. We are investigating this, whether it is the same problem or an entirely new one.

     

    I'll try to keep you updated on this once I have any news on the issue 🙂

     

    If you are affected by this and want to help us troubleshoot this, please fill out this quick survey. It helps us with developing a pattern and tracking down affected sessions.

     

    Update: Fixed typo in workaround

Resources