Enhancing Azure AD with Custom Attributes

Simplifying User Management in Azure AD

Customizing user profiles in Azure AD is a pivotal task for personalized identity management. This PowerShell script streamlines the update of custom attributes, such as contact details, ensuring user profiles are comprehensive and up-to-date.

# Script Type: Azure AD - Update User Attribute.ps1
# Author: Wesley Ellis
# Date: March 7, 2023
# Description: Updates a custom attribute for a specified user in Azure AD.


$userUPN = "<user@domain.com>"

$user = Get-AzureADUser -ObjectId $userUPN

if (!$user) {
    Write-Host "User not found in Azure AD."

$user.ExtensionProperty["extensionAttribute15"] = "<phone number>"

$result = Set-AzureADUser -Object $user

if (!$result) {
    Write-Host "Failed to update user object in Azure AD."

Write-Host "extensionAttribute15 updated for user $($user.UserPrincipalName)."

Leverage this script to efficiently manage and update Azure AD user attributes. By specifying the user’s UPN and desired attribute value, you can ensure your Azure AD environment remains organized and tailored to your organizational needs.


Leave a Reply

Your email address will not be published. Required fields are marked *