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

Sync doesn't work #28

Open BartDNL opened 3 years ago

BartDNL commented 3 years ago

I was expecting this script would remove accounts that are no longer listed in the GAL. Do I have the wrong assumption, or isn't it working as it supposed to work?

BartDNL commented 3 years ago

Forgot to assign/mention: @grahamr975

grahamr975 commented 3 years ago

The script does automatically remove contacts that are removed from the GAL; however, it cannot yet remove contacts with no email since I currently use the email as the unique identifier.

Exactly what issue are you experiencing?

BartDNL commented 3 years ago

Thanks. I'll ask my tech-guy, who implemented your script to join this ticket, so he can explain.

JeshuaEdgar commented 3 years ago

Hi @grahamr975 ,

First of all thanks for your resources. I'll jump in and give some more information.

Right now our setup consists of your script and a shared mailbox for the contacts to distribute it from a central point.

From reading the docs I believe that the folder will be wiped per sync so the contacts will be deleted and added again. However when deleting a contact from the GAL there's no sync to the shared mailbox, the contact remains in the shared mailbox contacts folder.

Maybe we're thinking wrong or doing something wrong. What is the best approach in this matter?

Thanks in advance!

grahamr975 commented 3 years ago

Hello @JeshuaEdgar @BartDNL ,

The script isn't designed to distribute contacts from a shared mailbox as a central point. Instead, it generates the GAL by pulling a list of all mailboxes/contacts in your directory. Perhaps this is the issue?

Yes, the script deletes any contacts no longer in the GAL. It does not wipe out the whole folder though, only contacts not detected in your tenet are deleted.

JeshuaEdgar commented 3 years ago

Hi Graham,

It's me again. Let me rephrase our situation. We have the GAL, and our syncing the GAL with your script to , not from a shared mailbox.

From what I understand the easiest and best way to distribute these contacts is by distributing them to the complete directory? We thought by syncing it to just the one mailbox and making it a shared one the whole control over the contacts distributed to the other users would be easier that way. We don't want to get into the situation where the whole list gets contaminated. Hence my question if it empties the contacts list. Sounds like we might have to rethink how we are going to roll this out.

What would your recommended approach be in this situation? Look forward hearing from you.

Cheers

grahamr975 commented 3 years ago

@JeshuaEdgar,

Happy holidays!

Yes, the script deletes the associated contacts for users no longer in your directory. Depending on your termination policies, you may not want to delete the user's account right away. In this case, just set HiddenFromAddressListsEnabled to True for the user's mailbox.

As for syncing to the whole directory or sharing a single folder, we've never tried using a shared folder in our environment so I can't really comment on its effectiveness.