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

Contacts in GAL are not Sync #10

Closed Floyz closed 4 years ago

Floyz commented 4 years ago

Hello !

I'm using the script with O365 and it's working well for me and create a contacts from all users that have mailbox .

But in my GAL I also have contacts (they doesn't require a licence), this is just a contact with a mail and a number, but no mailbox attached, so, in outlook I can browse them in the GAL subsection named "All Contacts" .

image

Theses contacts seems to be avoided / not synced in the folder where the script is creating local contacts.

Is this a known issue ? did I miss a configuration ? or any plans to implement that also ?

Regards !

grahamr975 commented 4 years ago

Until now, there was no configuration to include contacts without a directory mailbox.

I've added a 'IncludeNonMailboxContacts' switch to the script. You'll need to re-download it and run the script with this new switch. If you have any problems, let me know.

Floyz commented 4 years ago

Hello,

I have tested, it seems it added contacts for mailboxes present in sharedmailbox with no licences. But It still seems to not sync contact from the "contact" section of exchange.

On the Exchange perspective, it does sync entries in the underlined blue on this screen capture, but none on the red, even they got mail, phone number etc ... :

image

Floyz commented 4 years ago

Hello again, i changed a bit the script to include thoses contacts.

Because the contact list is fetched from Get-User, this list doesn't include contacts, so I needed to append to the contact list variable the return of Get-Contact .

I added a line at 51 in the Get-GALContacts.ps1 script in EWSContacts\Module\functions\contacts

image

This is working now with this. Thanks !

grahamr975 commented 4 years ago

I'll incorporate this as an optional switch. Thanks for finding this.

grahamr975 commented 4 years ago

I found my previous configuration to lack clarity, so I changed to default behavior to now automatically include shared mailboxes as contacts. It doesn't seem logical to exclude them by default. Now users will need to use the ExcludeSharedMailboxContacts switch if they need to exclude shared mailboxes. Anyways, to include non-user contacts you'll only need to use the IncludeNonUserContacts switch. All of the other changes in this latest update are documented in the change-log file. image