Skip to content

Connect-ExchangeOnline: Method not found: 'Microsoft.Identity.Client.PublicClientApplicationBuilder #3331

@raandree

Description

@raandree

Describe the bug

I am not sure if the issue is at the right location here but ExchangeOnlineManagement is not on GitHub unfortunately.

When calling Connect-ExchangeOnline after you called Connect-AzAccount you get the error:

OperationStopped: Method not found: 'Microsoft.Identity.Client.PublicClientApplicationBuilder
Microsoft.Identity.Client.Broker.BrokerExtension.WithBroker(Microsoft.Identity.Client.PublicClientApplicationBuilder, Microsoft.Identity.Client.BrokerOptions)'.

I have described a workaround in the discussion #3254 (comment).

Expected behavior

Connect-ExchangeOnline works without throwing errors even if the module Az.Accounts is imported.

How to reproduce

Install-Module Az.Accounts -Scope AllUsers -Force
Install-Module ExchangeOnlineManagement -Scope AllUsers -Force

Connect-AzAccount
Connect-Connect-ExchangeOnline #fails

SDK Version

ExchangeOnlineManagement 3.7.2

Latest version known to work for scenario above?

ExchangeOnlineManagement 3.7.1

Known Workarounds

Import-Module -Name ExchangeOnlineManagement
try
{
    Connect-ExchangeOnline -UserPrincipalName [email protected] -Credential $dummyCred | Out-Null
}
catch
{
    # Exception is expected
}

Debug output

VERBOSE: Returning precomputed version info: 3.8.0
VERBOSE: ModuleVersion: 3.8.0
VERBOSE: ConnectionContext Removed
OperationStopped: Method not found: 'Microsoft.Identity.Client.PublicClientApplicationBuilder
Microsoft.Identity.Client.Broker.BrokerExtension.WithBroker(Microsoft.Identity.Client.PublicClientApplicationBuilder,
Microsoft.Identity.Client.BrokerOptions)'.

Configuration

Name                           Value
----                           -----
PSVersion                      7.4.4
PSEdition                      Core
GitCommitId                    7.4.4
OS                             Microsoft Windows 10.0.20348
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions