Forum Discussion

VoMa1's avatar
VoMa1
Copper Contributor
Nov 22, 2021

Create/Update personal contacts with Powershell SDK

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

  • VoMa1's avatar
    VoMa1
    Copper Contributor

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

    https://docs.microsoft.com/en-us/answers/questions/636236/createupdate-personal-contacts-with-ms-graph-power.html

     

Resources