EWS-Office365-Contact-Sync
EWS-Office365-Contact-Sync copied to clipboard
The Autodiscover service couldn't be loaded
When I try to run the script and to the part where it start to load the EWSContact module. I get the following error: ERROR Failed to Sync-Contactlist for [email protected]. Exception on calling "AutodiscoverURL" with "2" arguments: The Autodiscover service couldn't be located.
@ThunderBandit what's your Exchange environment? Online? On-premise? Hybrid? I know that people have reported issues with on-premise exchange.
Hi i have the same error with my single mailbox test :( I'm using Exchange Online.
"ERROR Failed to Sync-ContactList for user Exception lors de l'appel de « AutodiscoverUrl » avec « 2 » argument(s) : « The Autodiscover service couldn't be located. »
I received the same error with hybrid Exchange 2016. Any suggestion?
Same error message here! Hybrid Exchange 2016 setup. Autodiscover to on-prem server, all mailboxes in Office365.
Unfortunately, I cannot test this issue in my own environment. Can someone with Exchange on-prem try changing line 74 of Connect-EXCExchange.ps1 to their version of Exchange server and let me know if this works?
$ExchangeVersion = [Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010_SP2
Never mind!! It's already working! I've done the following: On my management server I have edited the HOSTS file (Windows\system32\drivers\etc) and add the following line. (Don't do that on the live Exchange server!!)
52.97.176.40 autodiscover.owndomein.com
IP address is one of the addresses resolved from autodiscover.outlook.com
Now the script can find the autodiscover service of Office365 and it's working like a charm!
Greetings,
i was also getting this error after our last Exchange Update (the Hafnium-Security-Update (05.03.21) through WindowsUpdate).
AUSFÜHRLICH: Funktion "Write-AdminAuditLog" wird importiert. 2021.03.12 14:03:11 INFO Beginning contact sync for [email protected]'s mailbox AUSFÜHRLICH: Using EWS dll from Local Directory AUSFÜHRLICH: Using Modern Auth AUSFÜHRLICH: Modul wird aus Pfad ".\EWS-Office365-Contact-Sync-master\EWSContacts\Module\bin\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" geladen. 2021.03.12 14:03:12 ERROR Failed to Sync-ContactList for [email protected] Ausnahme beim Aufrufen von "AutodiscoverUrl" mit 2 Argument(en): "The Autodiscover service couldn't be located."
(the interesting parts are in english so i didn´t translate them)
We´re having a hybrid setup. Our Autodiscover can be found regularly and also shows no errors (checked via: https://testconnectivity.microsoft.com/tests/O365Ola/input )
@grahamr975 ive tried to change line 74 of Connect-EXCExchange.ps1 to
$ExchangeVersion = [Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2016
After this i also tried to check the suggestion of @marcellaven After switching the hosts-file it also worked again for me and was able to locate the autodiscover-service.
Thanks for your help guys!
I too have the issue with autodiscover.
2021/04/23 11:02:19 ERROR Failed to Sync-ContactList for [email protected] Exception calling "AutodiscoverUrl" with "2" argument(s): "The Autodiscover service couldn't be located."
- I'm currently in hybrid mode.
- My autodiscover URL is currently still pointed to an on-premise device (a load balancer)
- The machine I'm running the script from resolves the autodiscover URL to the internal IP of that device.
- I did try editing Connect-EXCExchange.ps1 and changed EX2010_SP2 to EX2016 to match my on-premise environment, but got the same error (also tried EX2016_CU16 just in case).
- I also added a hosts file entry for the outlook.com autodiscover, but still didn't have luck.
Hi,
Has fixed with me, Run this to allow secure connection [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls11,Tls12'
Then add those to hosts file as per you domain IP 150.105.150.30 autodiscover.Domain.Com 150.105.150.30 webmail.Domain.Com 150.105.150.30 Domain.Com