Closed Snake98bm closed 1 year ago
After applying the fix from JimSnead here
https://github.com/grahamr975/EWS-Office365-Contact-Sync/issues/56#issuecomment-1198509331
I couldn't use the -ExcludeSharedMailboxContacts flag. Here is orginal code from JimSnead
$DirectoryList = $(Get-EXOMailbox -ResultSize unlimited | Where-Object {$_.HiddenFromAddressListsEnabled -Match "False"}) $EmailAddressList = $DirectoryList.PrimarySMTPAddress $ContactList = $ContactList | Select-Object DisplayName,FirstName,LastName,Title,Company,Department,WindowsEmailAddress,Phone,MobilePhone | Where-Object {$EmailAddressList.Contains($_.WindowsEmailAddress)} } else { $ContactList = $ContactList | Select-Object DisplayName,FirstName,LastName,Title,Company,Department,WindowsEmailAddress,Phone,MobilePhone }
Here is the fix for the code.
$DirectoryList = $(Get-EXOMailbox -ResultSize unlimited -PropertySets Minimum,AddressList | Where-Object {$_.HiddenFromAddressListsEnabled -Match "False"}) $EmailAddressList = $DirectoryList.PrimarySMTPAddress $ContactList = $ContactList | Select-Object DisplayName,FirstName,LastName,Title,Company,Department,WindowsEmailAddress,Phone,MobilePhone | Where-Object {$EmailAddressList.Contains($_.WindowsEmailAddress)} } else { $ContactList = $ContactList | Select-Object DisplayName,FirstName,LastName,Title,Company,Department,WindowsEmailAddress,Phone,MobilePhone }
Sorry couldn't do a pull request.
@Snake98bm thanks for posting this
@Snake98bm
I applied this fix along with the OAuth upgrade in commit 9fcfe1f06192848882564615dd9aa05e71d69970. Please reach out if you have any questions.
After applying the fix from JimSnead here
https://github.com/grahamr975/EWS-Office365-Contact-Sync/issues/56#issuecomment-1198509331
I couldn't use the -ExcludeSharedMailboxContacts flag. Here is orginal code from JimSnead
Here is the fix for the code.
Sorry couldn't do a pull request.