How to set a user extension using PowerShell scripts

A user extension is a custom attribute that can store additional information about a user in Azure Active Directory (AD). Extension attributes are similar to custom attributes. You can create an extension attribute for users, tenant details, devices, and applications. Applications objects in the developer's directory have extension properties registered on them. Once the application has received consent from either a user or an administrator in the developer's directory, the property is integrated into the designated directory type and becomes accessible within the developer’s directory.

The below mentioned cmdlet allows you to set an extension attributes to a user in Azure AD.

Azure PowerShell

Steps to set a user extension in Azure AD using PowerShell scripts:

  1. Note down the required parameters (ObjectId, ExtensionName, ExtensionValue, and other common parameters) for setting the user extension.
  2. Execute the following PowerShell script with the required parameters and their values.
 Copied
Set-AzureADUserExtension
-ObjectId <ObjectId>
-ExtensionName <ExtName>
-ExtensionValue <ExtVal>
[<CommonParameters>]
Click to copy entire script

Where <ObjectId> refers to the ID of an object, <ExtName> refers to the name of the extension, and <ExtVal> refers to the extension value.

ADManager Plus:

Steps to set a user extension in Azure AD using ADManager Plus:

  1. Log in to ADManager Plus and navigate to the Microsoft 365 tab > Management > User Management.
  2. Under Bulk User Modification, click Modify Naming Attributes.
  3. Select the desired Microsoft 365 tenant from the Microsoft 365 Tenant drop-down.
  4. Browse and select the CSV file containing the list of users and the extension attributes, and click Import User(s).
  5. Select the desired users and click Apply.
How to set a user extension using PowerShell scripts
 

In the above example, the Employee ID user extension will be applied to all the selected users.

Limitations of using PowerShell scripts to set a user extension

  • Administrators must have sufficient permissions to modify attributes of Azure AD users if they wish to use the above-mentioned PowerShell script. However, one wrong move from the administrator can affect the security posture of your organization.
  • Only technicians with PowerShell expertise can execute this command.
  • PowerShell scripts are time-consuming and can affect productivity.
  • For each user, administrators should run the provided script individually to update their information.

About ManageEngine ADManager Plus

MManageEngine ADManager Plus is a unified Active Directory (AD), Microsoft 365, Exchange, and Google Workspace management and reporting solution. It comes with predefined management actions that can be executed at the click of a button and more than 200 reports to report on your AD comprehensively. ADManager Plus' automation capabilities allows you to automate mundane and routine AD tasks, associate workflows to them, and have them executed at a defined frequency. It also lets you securely delegate tasks to technicians and non-admin users. ADManager Plus let's you create custom attributes for accommodating unique data in your Azure AD environment. ADManager Plus can also be integrated with enterprise applications to holistically manage your AD environment. To learn more about ADManager Plus, click here

Simplify Azure AD management and reporting with ADManager Plus

  Get 30-day free trial.
  • Embark on your script-free AD management, reporting, and automation journey with ADManager Plus.
  •  
  • By clicking 'Start your free trial now', you agree to processing of personal data according to the Privacy Policy.
  • Thanks
  • Your download should begin automatically in 15 seconds. If not, click here to download manually.

Related Powershell How-to Guides:

The one-stop solution toActive Directory Management and Reporting

Email Download Link