Skip to content

Connect-M365Tenant cannot connect to ExchangeOnline with Managed Identity #186

@raandree

Description

@raandree

When trying to connect to ExchangeOnline using Connect-M365Tenant

Connect-M365Tenant -Workload ExchangeOnline -Identity -TenantId MngEnvMCAP576786.onmicrosoft.com

you may get the following error:

Value cannot be null.
Parameter name: Organization cannot be null for Managed Identity based connections.
At C:\Program Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\3.4.0\netFramework\ExchangeOnlineManagement.psm1:762 char:21
+                     throw $_.Exception.InnerException;
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], ArgumentNullException
    + FullyQualifiedErrorId : Value cannot be null.
Parameter name: Organization cannot be null for Managed Identity based connections.

Unfortunately, the error handling obfuscates the real error.

In case of the error, Get-MSCloudLoginOrganizationName does not return anything.

Get-MSCloudLoginOrganizationName -Identity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions