EWS-Office365-Contact-Sync
EWS-Office365-Contact-Sync copied to clipboard
Contact beeing excluded with -ExcludeSharedMailboxContacts if Emailaddress is in capital letters
Hi,
first of all: Really great job with the script! we run into the problem, that for some human error a couple of users were created with capital letters in their username and therefor in their email address. We can change that username and alias in Exchange and AD no problem, but for some reason the Get-GALContacts.ps1 still shows the email with capital letters. Even after a couple of days, because the GAL is only updated once a day (maybe?).
So after digging into the script i found out i need to alter the following in line 59 Get-GALContacts.ps1. I also added the "HomePhone" attribut in there, because we want to sync those fields also.
$ContactList = $ContactList | Select-Object DisplayName,FirstName,LastName,Title,Company,Department,WindowsEmailAddress,Phone,MobilePhone,HomePhone | Where-Object {$EmailAddressList.Contains($_.WindowsEmailAddress)}
The new one:
$ContactList = $ContactList | Select-Object DisplayName,FirstName,LastName,Title,Company,Department,WindowsEmailAddress,Phone,MobilePhone,HomePhone | Where-Object {$EmailAddressList.Contains($_.WindowsEmailAddress.ToLower())}
Now the scripts creates all the contacts in the user mailbox.
Thanks, Christian
PS: I also added two other features for the script: a) Use an Active Directory Group for selecting the user who receives the contacts in their Outlook and b) Populate the the "HomePhone" and "FileAs" in the created contact. Should i open another "issue" if you are interested?
@christianneeb
Good work on this. I'll work on fixing the filtering within the main script as time allows.
Regards, Ryan
This has been fully fixed by commit e6da2a4173219401aa60ecd6aa991916077a9a77