grahamr975 / EWS-Office365-Contact-Sync

Uses Exchange Web Services to synchronize a Global Address List in Office 365 to a user's mailbox
MIT License
96 stars 21 forks source link

Error since 15.03.2022 #52

Open mandelbrotmedia opened 2 years ago

mandelbrotmedia commented 2 years ago

Hi,

since last tuesday 15.03.2022 i get the following error:

2022.03.18 07:00:33 INFO Beginning contact sync for name@domain.com's mailbox AUSFÜHRLICH: Using EWS dll from Local Directory AUSFÜHRLICH: Using Modern Auth AUSFÜHRLICH: Modul wird aus Pfad "C:\EWS-Office365-Contact-Sync\EWSContacts\Module\bin\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" geladen. PS>TerminatingError(Get-EXCContactFolder): "Ausnahme beim Aufrufen von "Bind" mit 2 Argument(en): "The request failed. Die zugrunde liegende Verbindung wurde geschlossen: Unerwarteter Fehler beim Senden.."" AUSFÜHRLICH: COMPANY Kontakte not found, attempting to create now...

any idea whats wrong? did MS change something?

paochiz commented 2 years ago

Hi mee too :( Since 15/03/2022 it's not working :( Any help?

Write-Log : Failed to fetch Global Address List Contacts from Office 365 Directory In riga:77 car:3

grahamr975 commented 2 years ago

I think I've seen this before in issue #46. If you recently enabled MFA in your environment, this could be the cause. Please see below. Others have had success by creating an Azure App.

This issue is from the ExchangeOnline Powershell Module and occurs for one of the following reasons:

  • You enter an incorrect user name or password.
  • You try to sign in to the service by using an account that doesn't have access to Exchange Online.
  • You have security defaults enabled in your tenant. Source

Note that the ExchangeOnline Powershell Module in this script still uses basic authentication. It's on my to-do list to migrate this over to OAuth just as I have done for the EWS portions.

We only use ExchangeOnline to retrieve the contacts, so if you're up to the challenge you could follow a guide like the one here to set up an AzureAD App. After that, you'd need to modify the function here: https://github.com/grahamr975/EWS-Office365-Contact-Sync/blob/master/EWSContacts/Module/functions/contacts/Get-GALContacts.ps1

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri $ConnectionUri -Credential $Credentials -Authentication Basic -AllowRedirection

mandelbrotmedia commented 2 years ago

you are right, i activated MFA a feew weeks ago. but the script worked after that. now i found out that on my local windows 11 pc the script works without error. only on my server with windows server 2016 it stopped working since 15.03.2022.

i think it must be an issue with windows updates or some dependencies

paochiz commented 2 years ago

Sale problem

Dr. Paolo Chiorazzo

@.**@.>

ALYA Infrastrutture <x-apple-data-detectors://0/2>Via Andrea Ercolani, 9<x-apple-data-detectors://0/2> 40026 Imola BO<x-apple-data-detectors://0/2> Cell. +39 3319146264<tel:+39%203319146264>

+39 3881493152<tel:+39%203881493152> http://www.alya.it/


Da: mandelbrotmedia @.> Inviato: Tuesday, March 29, 2022 7:47:02 AM A: grahamr975/EWS-Office365-Contact-Sync @.> Cc: Paolo Chiorazzo @.>; Comment @.> Oggetto: Re: [grahamr975/EWS-Office365-Contact-Sync] Error since 15.03.2022 (Issue #52)

you are right, i activeted MFA a feew weeks ago. but the script worked after that. now i found out that on my local windows 11 pc the script works without error. only on my server with windows server 2016 it stopped working since 15.03.2022.

i think it must be an issue with windows updates or some dependencies

— Reply to this email directly, view it on GitHubhttps://github.com/grahamr975/EWS-Office365-Contact-Sync/issues/52#issuecomment-1081428934, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALXWGN7SBNROZGSTPYZN5PLVCKKNNANCNFSM5RA6LRIQ. You are receiving this because you commented.Message ID: @.***>

JimSnead commented 2 years ago

Here is a link to my comment about a fix for the "Failed to fetch Global Address list contacts" error.

https://github.com/grahamr975/EWS-Office365-Contact-Sync/issues/56#issuecomment-1198509331

grahamr975 commented 1 year ago

@paochiz and others,

Could you try the latest version (commit 9fcfe1f06192848882564615dd9aa05e71d69970) and see if this fixes your issues?