Graph API and extensionAttribute

AdamTyler-3590 305 Reputation points
2024-12-11T17:44:59.52+00:00

Hello, I am attempting to modify extensionAttribute5 on an account in Entra ID that was synchronized from our on-prem environment via AD Connect. Currently AD Connect is not configured to sync extensionAttribute's, I am testing something with a custom app (SCIM) and wanted to temporarily update this content on a test account to validate before going this far.

Anyway, I am using the below PowerShell commands to connect via Graph and populate the extensionAttribute5 with a custom string. The commands all seem to complete successfully without error, but the attribute is never updated. Any ideas?

Connect-MgGraph -Scopes "User.ReadWrite.All"
# Get the user
$user = Get-MgUser -UserId "******@domain.com"
$userId = $user.Id
# Define the attributes as a hash table (dictionary)
$Attributes = @{
    "onPremisesExtensionAttributes" = @{
        "extensionAttribute5" = "Custom-String"
    }
}
# Update the user with the hash table (no need to convert to JSON explicitly)
Update-MgUser -UserId $userId -BodyParameter $Attributes
Microsoft Security Microsoft Entra Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. James Hamil 27,211 Reputation points Microsoft Employee Moderator
    2024-12-11T19:25:45.5133333+00:00

    Hi @AdamTyler-3590 , according to this document, what you're doing may not be supported: "It is not supported to sync attribute values from Microsoft Entra Connect to extension attributes that are not created by Microsoft Entra Connect. Doing so may produce performance issues and unexpected results. Only extension attributes that are created as shown in the above are supported for synchronization."

    Please review that document and let me know if you have any questions.

    If this answer helps you please mark "Accept Answer" so other users can reference it.

    Thank you,

    James


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.