Open choffman91 opened 2 years ago
Choffman,
The ExcludeSharedMailboxContacts switch does not sync contacts that don't have a WindowsEmailAddress and a legitimate mailbox. Secondly, the ExcludeContactsWithoutPhoneNumber switch does not sync contacts that don't have a Phone or Mobile phone. Hopefully, this helps clear up any confusion. Could you please include a sanitized log?
Thanks for the quick response.
I am working sanitizing a long, but I can tell you that all of our shared mailboxes are being synced. I will get the sanitized log added soon.
I think I have something wrong with my syntax of running the batch file:
PowerShell.exe -ExecutionPolicy Bypass ^ -File "%CD%\EWSContactSync.ps1" ^ -CredentialPath "REDACTED" ^ -FolderName "REDACTED" ^ -IncludeNonUserContacts Enabled ^ -ExcludeSharedMailboxContacts Enabled ^ -MailboxList DIRECTORY ^ -LogPath "REDACTED" ^ -ModernAuth
@choffman91
Try the below instead
PowerShell.exe -ExecutionPolicy Bypass ^ -File "%CD%\EWSContactSync.ps1" ^ -CredentialPath "REDACTED" ^ -FolderName "REDACTED" ^ -IncludeNonUserContacts ^ -ExcludeSharedMailboxContacts ^ -MailboxList DIRECTORY ^ -LogPath "REDACTED" ^ -ModernAuth
Well that one ran at least, but it all of the shared contacts and regular users.
@choffman91
After reviewing the code again, can you please try to set HiddenFromAddressListsEnabled to true for the mailboxes you want to hide from the script/GAL? Let me know if this solution works for you. https://docs.microsoft.com/en-us/exchange/address-books/address-lists/manage-address-lists
I have the switches to ExcludeContactsWithoutPhoneNumber and ExcludeSharedMailboxContacts enabled, but contacts that are under both categories still sync