Create/Update personal contacts with Powershell SDK

Copper Contributor

Hello,

 

my goal is to sync active directory users to users personal outlook contacts. I try it and it seems to be very easy but after a several tries I mentioned that the "Display as" field wasn't filled correctly.

It always filled out with the Surname and the Givenname instead of what I want to. (Givenname Surname + mailaddress)

 

What I found out is that the field is only filled out incorrectly for users with a Exchange Online license. 

The field is filled in correctly for users who do not have a license and I really don't know why? Can anyone explane me why?

 

 

 

$anzeigenals=$displayName + " (" + $EmailAddresses + ")"
$MAIL= @{Address = $EmailAddresses; Name = $anzeigenals}

New-MgUserContact -UserId $graphuser.Id -BusinessPhones $BusinessPhones -CompanyName $CompanyName -Department $department -DisplayName $displayName -FileAs $FileAs -GivenName $GivenName -JobTitle $Jobtitle -Initials $Initials -Manager $Manager -MobilePhone $MobilePhone -OfficeLocation $OfficeLocation -Surname $Surename -EmailAddresses $mail -BusinessAddress $Anschrift -PersonalNotes $personalnotes

 

 

 

 

1 Reply

For everyone who want to know more about the problem we discuss this here:

Create/Update personal contacts with MS Graph Powershell SDK - Microsoft Q&A