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

Exclude users with "Hide from address lists" #42

Closed rypto closed 3 years ago

rypto commented 3 years ago

Hi! I'm executing the script with the switch -ExcludeContactWithoutPhoneNumber and it works fine but I'm also getting users that are hidden from the gal. Any ideas on how to exclude those as well?

grahamr975 commented 3 years ago

The ExcludeSharedMailboxContacts switch does not sync contacts that are hidden from the GAL. I'd suggest trying out this switch as well.

rypto commented 1 year ago

Must open this up.. I use the script with the -ExcludeContactsWithoutPhoneNumber switch and all my 210 users get synced (as intended), including the ones hidden from GAL. (not intended)

When I add -ExcludeSharedMailboxContacts to the script it deletes a bunch of contacts leaving me with only 70 contacts

The deleted contacts are all active users with phone numbers, e-mail addresses and not shared mailboxes, and only a few are hidden from GAL

What can cause this? Any hints? Thank you