When trying to add an Office 365 Target Organization, the following error occurs:
Invalid user:
'serviceaccount@domain.onmicrosoft.com'
Additionally, in the EMWMigration.log, you will see the following error stack:
2020-03-09 17:09:08.0405 Px40C Tx1 A- C- M- Error MMEx.General.WebServices|Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverRequest.InternalExecute\tError: Exception:
Microsoft.Exchange.WebServices.Data.ServiceRequestException: The request failed. The remote server returned an error: (401) Unauthorized. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.Exchange.WebServices.Data.EwsHttpWebRequest.Microsoft.Exchange.WebServices.Data.IEwsHttpWebRequest.GetResponse()
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverRequest.InternalExecute()
--- End of inner exception stack trace ---
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverRequest.InternalExecute()
at Microsoft.Exchange.WebServices.Autodiscover.GetUserSettingsRequest.Execute()
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetUserSettings(List`1 smtpAddresses, List`1 settings, Nullable`1 requestedVersion, Uri& autodiscoverUrl)
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetSettings[TGetSettingsResponseCollection,TSettingName](List`1 identities, List`1 settings, Nullable`1 requestedVersion, GetSettingsMethod`2 getSettingsMethod, Func`1 getDomainMethod)
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetUserSettings(List`1 smtpAddresses, List`1 settings)
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetSoapUserSettings(String smtpAddress, List`1 requestedSettings)
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetUserSettings(String userSmtpAddress, UserSettingName[] userSettingNames)
at MMEx.General.Autodiscover.ExchangeAutodiscoverService.GetUserSettings(String userSmtpAddress, UserSettingName[] userSettingNames)
at MMEx.General.Autodiscover.Autodiscover.GetUserSettings(String emailAddress, NetworkCredential creds, Uri& autodiscoverUrl, Boolean enableScpLookup, Nullable`1& isExternal, AutodiscoverUserSetting[] userSettingNames)
at MMEx.General.Autodiscover.Autodiscover.GetUserSettings(String emailAddress, NetworkCredential creds, Uri autodiscoverUrl, Boolean enableScpLookup, AutodiscoverUserSetting[] userSettingNames)
at MigrationManager.Exchange.Basis.O365.Office365MailboxChecker.IsMailboxExist(String upn, Boolean searchUpnViaMsol)
at MigrationManager.Exchange.Core.Office365Helper.CheckConnectivity(String username, String password, Exception& errorMsg)System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.Exchange.WebServices.Data.EwsHttpWebRequest.Microsoft.Exchange.WebServices.Data.IEwsHttpWebRequest.GetResponse()
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverRequest.InternalExecute()
on
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverRequest.InternalExecute()
at Microsoft.Exchange.WebServices.Autodiscover.GetUserSettingsRequest.Execute()
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetUserSettings(List`1 smtpAddresses, List`1 settings, Nullable`1 requestedVersion, Uri& autodiscoverUrl)
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetSettings[TGetSettingsResponseCollection,TSettingName](List`1 identities, List`1 settings, Nullable`1 requestedVersion, GetSettingsMethod`2 getSettingsMethod, Func`1 getDomainMethod)
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetUserSettings(List`1 smtpAddresses, List`1 settings)
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetSoapUserSettings(String smtpAddress, List`1 requestedSettings)
at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetUserSettings(String userSmtpAddress, UserSettingName[] userSettingNames)
at MMEx.General.Autodiscover.ExchangeAutodiscoverService.GetUserSettings(String userSmtpAddress, UserSettingName[] userSettingNames)
at MMEx.General.Autodiscover.Autodiscover.GetUserSettings(String emailAddress, NetworkCredential creds, Uri& autodiscoverUrl, Boolean enableScpLookup, Nullable`1& isExternal, AutodiscoverUserSetting[] userSettingNames)
at MMEx.General.Autodiscover.Autodiscover.GetUserSettings(String emailAddress, NetworkCredential creds, Uri autodiscoverUrl, Boolean enableScpLookup, AutodiscoverUserSetting[] userSettingNames)
at MigrationManager.Exchange.Basis.O365.Office365MailboxChecker.IsMailboxExist(String upn, Boolean searchUpnViaMsol)
at MigrationManager.Exchange.Core.Office365Helper.CheckConnectivity(String username, String password, Exception& errorMsg)