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
99 stars 21 forks source link

Failed to fetch Global Address List Contacts from Office 365 Directory #68

Closed rypto closed 1 year ago

rypto commented 2 years ago

Hi,

I'm sure I'm doing something wrong. I get the following when testing the script to only one user. What could be the issue? image

rypto commented 2 years ago

I added -UseRPSSession to line 57 in Get-GALContacts.ps1 and it works now

Connect-ExchangeOnline -UseRPSSession -ConnectionUri $ConnectionUri -CertificateFilePath $CertificatePath -CertificatePassword $CertificatePassword -AppId $ClientID -Organization $ExchangeOrg

AisaacOcean commented 2 years ago

Hi, I am also running it for a single user and I get the same problem.

I have tried what Rypto said but I get the same error.

Why is this error occurring?

grahamr975 commented 1 year ago

It looks like you're using Exchange Online Powershell version 3.0.0. You need to use version 2.0.5 with the script. Please see the README.

rypto commented 1 year ago

Indeed, sorry for not checking. Using version 2.0.5 solved the problem and other problems related to the switches as well. So using version 2.0.5 you don't need to use that string I provided above