Skip to content

OnPrem impersonation requires mailbox on-premises #1573

@jimthemcp

Description

@jimthemcp

When using an impersonation account that either doesn't have a mailbox or their mailbox is in EXO, you get the following error:
Could not open mailbox. Error:

Exception calling "Bind" with "2" argument(s): "The SMTP address has no mailbox associated with it."

This is a result of checking the credentials from this line:
CheckOnpremCredentials -ewsService $Service

which calls the function and fails here:
try {
$null = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($ewsService, [Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::MsgFolderRoot)
}

the mailbox not found exception could be used to validate the credentials as well, as it does show the connection succeeded

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions