Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclusion switches do not work #54

Open
choffman91 opened this issue Mar 23, 2022 · 6 comments
Open

Exclusion switches do not work #54

choffman91 opened this issue Mar 23, 2022 · 6 comments

Comments

@choffman91
Copy link

I have the switches to ExcludeContactsWithoutPhoneNumber and ExcludeSharedMailboxContacts enabled, but contacts that are under both categories still sync

@grahamr975
Copy link
Owner

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?

@choffman91
Copy link
Author

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.

@choffman91
Copy link
Author

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

@grahamr975
Copy link
Owner

@choffman91

Try the below instead

PowerShell.exe -ExecutionPolicy Bypass ^
-File "%CD%\EWSContactSync.ps1" ^
-CredentialPath "REDACTED" ^
-FolderName "REDACTED" ^
-IncludeNonUserContacts ^
-ExcludeSharedMailboxContacts ^
-MailboxList DIRECTORY ^
-LogPath "REDACTED" ^
-ModernAuth

@choffman91
Copy link
Author

Well that one ran at least, but it all of the shared contacts and regular users.

GALSync Log.txt

@grahamr975
Copy link
Owner

grahamr975 commented Jun 29, 2022

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants