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.

Connect-AzureAD

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

$user = Get-AzureADUser -ObjectId $userUPN

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

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

$result = Set-AzureADUser -Object $user

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

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.