Forum Discussion

Konstantinos N. Chionas's avatar
Konstantinos N. Chionas
Copper Contributor
Jul 04, 2023

MS Graph and AzureADUserExtension

Migration from Azure AD to MS Graph documentation, maps Set-AzureADUserExtension to Update-MgUserExtension.

 

I used to use the following command to set user's ExtensionAttribute:

 

Set-AzureADUserExtension -ObjectId <email> -ExtensionName 'extensionAttribute1' -ExtensionValue 'Test'

 

How to do that with Update-MgUserExtension?

  • Update-MgUserExtension is not what you need here, just Update-MgUser:

    $Attributes = @{
    "onPremisesExtensionAttributes" = @{
    "extensionAttribute1" = "bla"
    "extensionAttribute2" = "bla"
    } | ConvertTo-Json

    Update-MgUser -UserId blabla -BodyParameter $Attributes
  • Update-MgUserExtension is not what you need here, just Update-MgUser:

    $Attributes = @{
    "onPremisesExtensionAttributes" = @{
    "extensionAttribute1" = "bla"
    "extensionAttribute2" = "bla"
    } | ConvertTo-Json

    Update-MgUser -UserId blabla -BodyParameter $Attributes

Resources