Forum Discussion
Konstantinos N. Chionas
Jul 04, 2023Copper Contributor
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- Konstantinos N. ChionasCopper Contributor
VasilMichev This worked for me, just missing closing }. Thank you.