How to transfer data between Active Directory attributes in bulk
Problem:
You use an attribute which is not supported by CodeTwo Email Signatures for Office 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.
Solution:
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 Azure Active Directory 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 for Office 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 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:
- Log in to any server machine in your Azure Directory domain, using the admin account.
- Open the PowerShell console (for example by clicking Start and typing powershell).
- 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}}
Info
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.
- Sync the local AD attributes with the cloud by using the Azure Active Directory 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 for Office 365 (Fig. 1.).
Fig. 1. Inserting the CustomAttribute1 placeholder into a signature template.
Tip
If you’re planning to use non-standard attributes in your signatures, disclaimers or auto-replies, you can use our User attributes manager. It lets you easily create custom attributes to be used with CodeTwo Email Signatures for Office 365 without affecting your Azure AD or AD data. Learn more
See also:
Related products: | CodeTwo Email Signatures for Office 365 1.x |
Categories: | How-To |
Last modified: | June 15, 2022 |
Created: | October 12, 2021 |
ID: | 948 |