Update: Below issue corrected after reinstalling Exchange Online Management v2.0.4-Preview. I suspect there was some corruption during the initial install. Thank you.
We’re in a hybrid Exchange/O365 environment managed in great part by PowerShell scripts.
I am trying to migrate scripts from 5.0 to 7.1. I’ve installed PS v7.1 x64 and Exchange Online Management v2.0.4-Preview6.
Connect-ExchangeOnline -UserPrincipalName globalAdmin@contoso.com -ShowProgress $true Set-Mailbox -Identity firstname.lastname@example.org -GrantSendOnBehalfTo email@example.com Disconnect-ExchangeOnline -Confirm:$falseThe above runs in v5 with the following message:
Creating a new Remote PowerShell session using Modern Authentication for implicit remoting of “Set-Mailbox” command …
When the same script is run on v7.1 it fails with the following error:
Set-Mailbox: Recipient “email-one” couldn’t be read from domain controller “xxxxxxxxxxxxxxxx.PROD.OUTLOOK.COM”. This may be due to replication delays. Switching out of Forest mode should allow this operation to complete successfully.
Seems like it’s failing to connect to Azure AD. But why v5 connects and not 7.1 ?