Knowledge Base

How to transfer data between Active Directory attributes in bulk


You use an attribute which is not supported by CodeTwo Email Signatures 365. You would like to find an automated way to make a value stored in this attribute available for use in our software as a placeholder.


Let’s assume that you have an academicTitle attribute which you use to store an academic title for each user in your organization. It is a local (on-premises) attribute, so you use the Microsoft Entra Connect (Azure AD Connect) tool to synchronize it with the cloud (Microsoft 365). Unfortunately, after extending schema, completing the sync, etc., you are still unable to select the attribute in the signature template editor because it is simply not there. Copying attribute’s value to another attribute for each user manually is out of question because there is a large number of users in your organization.

Instead, the best option for this scenario is as follows:

  • Choose another attribute that can be used by CodeTwo Email Signatures 365. A good candidate is one of the local extension attributes, e.g. extensionAttribute1, because it does not require you to extend the Active Directory schema and, once you sync it to Entra ID (Azure AD), is mapped directly to CustomAttribute1 which you can access in our signature template editor.
  • Next, copy values from the unsupported attribute (academicTitle) to extensionAttribute1 in bulk by using PowerShell to later sync it to the Microsoft 365 cloud. 

Read on to learn how to do it in detail:

  1. Sign in to any server machine in your Azure Directory domain, using the admin account.
  2. Open the PowerShell console (for example by clicking Start and typing powershell).
  3. Use the following script:
    $users = Get-ADUser -Filter * -Properties *|Where-Object {$_.academicTitle -ne $null }| Select-Object sAMAccountName,academicTitle
    foreach($user in $users) {Set-ADUser -identity $user.sAMAccountName -add @{extensionAttribute1=$user.academicTitle}}


    If you want to copy an attribute value for selected users only, replace the asterisk (*) after the -Filter switch with an appropriate query code. Learn more

    Once the script is executed, the value stored in the academicTitle attribute for each user in your organization will be automatically copied to extensionAttribute1 for the same user.

  4. Sync the local AD attributes with the cloud by using the Microsoft Entra Connect (Azure AD Connect) tool.

Now that all the data is synced, you will be able to insert an academic title of your user by using the CustomAttribute1 attribute in the signature template editor of CodeTwo Email Signatures 365 (Fig. 1.).

Inserting the CustomAttribute1 placeholder into a signature template.
Fig. 1. Inserting the CustomAttribute1 placeholder into a signature template.


If you’re planning to use non-standard attributes in your signatures, disclaimers or auto-replies, you can use our Attributes manager. It lets you easily create custom attributes to be used with CodeTwo Email Signatures 365 without affecting your Entra ID (Azure AD) or Active Directory data. Learn more

See also:

Was this information useful?