cannot connect to exchange online via powershell

Anonymous
2020-06-24T16:23:06+00:00

I am unable to access exchange online via powershell anymore. it has been about 2 or 3 months since i have tried but this used to work with no issues. 

I have tried connecting 3 ways, all of which fail with the same error

#1

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession -Session $Session -DisableNameChecking

the progress bar comes up, it says importing and counts up to 6 or 700 commands as expected then the unexpected error message:

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

After that, none of the commands work - example Get-Mailbox 

#2

Connect-EXOPSSession -UserPrincipalName ******@x.com

same deal. same error

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

At C:\Users\x\AppData\Local\Apps\2.0\A53V0WOT.PE1\6Y7OL9NA.H46\micr..tion_1f16bd4ec4c2bb19_0010.0000_673f37

c317fb5976\CreateExoPSSession.ps1:311 char:40

  • ...      $PSSessionModuleInfo = Import-PSSession $PSSession -AllowClobber

+                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidResult: (:) [Import-PSSession], ArgumentException

    + FullyQualifiedErrorId : ErrorMalformedDataFromRemoteCommand,Microsoft.PowerShell.Commands.ImportPSSessionCommand

#3

Connect-ExchangeOnline -UserPrincipalName ******@x.com -ShowProgress $true

same deal. same error

The module allows access to all existing remote PowerShell (V1) cmdlets in addition to the 9 new, faster, and more reliable cmdlets.

|--------------------------------------------------------------------------|

|    Old Cmdlets                    |    New/Reliable/Faster Cmdlets       |

|--------------------------------------------------------------------------|

|    Get-CASMailbox                 |    Get-EXOCASMailbox                 |

|    Get-Mailbox                    |    Get-EXOMailbox                    |

|    Get-MailboxFolderPermission    |    Get-EXOMailboxFolderPermission    |

|    Get-MailboxFolderStatistics    |    Get-EXOMailboxFolderStatistics    |

|    Get-MailboxPermission          |    Get-EXOMailboxPermission          |

|    Get-MailboxStatistics          |    Get-EXOMailboxStatistics          |

|    Get-MobileDeviceStatistics     |    Get-EXOMobileDeviceStatistics     |

|    Get-Recipient                  |    Get-EXORecipient                  |

|    Get-RecipientPermission        |    Get-EXORecipientPermission        |

|--------------------------------------------------------------------------|

To get additional information, run: Get-Help Connect-ExchangeOnline or check https://aka.ms/exops-docs

Send your product improvement suggestions and feedback to ******@service.microsoft.com. For issues related to the module, contact Microsoft support. Don't use the feedback alias for problems or support issues.


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

At C:\Program Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\1.0.1\ExchangeOnlineManagement.psm1:454 char:40

  • ... oduleInfo = Import-PSSession $PSSession -AllowClobber -DisableNameChe ...

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidResult: (:) [Import-PSSession], ArgumentException

    + FullyQualifiedErrorId : ErrorMalformedDataFromRemoteCommand,Microsoft.PowerShell.Commands.ImportPSSessionCommand

At this point effectively unable to admin exchange online via powershell. Anyone have any ideas?

Microsoft 365 and Office | Subscription, account, billing | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

87 answers

Sort by: Oldest
  1. Anonymous
    2020-07-14T13:43:44+00:00

    I would feel better if others on my team were having this issue, but it seems to be just me, so very strange.

    Thanks for being in contact and providing updates

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2020-07-14T13:52:59+00:00

    Hello all

    Thanks to everyone for your input on this issue. For my part, I have not got the error since I first participated in this thread. I haven't change anything and the authentication just goes trough as it did for the last 4 years! Odd enough and scarry at the same time....

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2020-07-14T16:03:24+00:00

    I'm getting the same error.  In reading through this thread it seems that individuals using cloud only accounts for this connection may be having this issue.  I've tried all the workarounds while still using my cloud only account and none of them work.  If I use a synced account everything appears to be OK.   This is quite problematic as all my nightly process run using our cloud only account so things we do like locking accounts for termination, reclaiming licenses and the like have all started to fail.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2020-07-14T16:44:57+00:00

    Agreed Sandi! I actually have an executive meeting this afternoon to discuss this and how we are going to "semi-automate" a solution until the issue has been resolved. I am hopeful but we need a definitive solution vs a workaround. Just my .2 cents.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2020-07-14T18:17:20+00:00

    Hi everybody,

    Unfortunately, I don't have any sudden relieve to report.

    We are still working on tracing this elusive problem and will provide updates as soon as we have something new to report.

    So far nothing new, however reports of the workaround not working have caused significant concern. Unfortunately, we were able to reproduce that - among other things because the form did not capture the data, so we could not be sure what account faced the problem. For the ones we were able to test against, that also still had the problem, we were unable to reproduce.

    In response to that, I have now updated the Form to capture that information.

    It will also ask you, whether you are willing to be contacted by us (me, most likely) to assist in the troubleshooting. There is no guarantee we will actually contact a person agreeing to that - given the transient nature of this problem, we will only contact you very soon after filling out the form, if at all.

    Cheers,

    Friedrich

    Was this answer helpful?

    0 comments No comments