Skip to main content

Enable and Disable Active Directory Users

Data Sync makes it very easy to set users as enabled or disabled in Active Directory, you just need to update the UserAccountControl attribute by passing a boolean value.

This page shows the process you need to follow to set the Active Directory useraccountcontrol attribute to enable or disable your users.

You may be given a list of users that need to be either enabled or disabled in Active Directory, for example this list might be in SharePoint, it might come from your HR system or it might be a document.

This needs to have a field with true or false values to say if the account is enabled or disabled.

Sample Data

To enable and disable users in Active Directory you need to connect to your list of users as your source, and connect to your Active Directory OU where your users are located as your target. Make sure to use the Active Directory V2 - Users/Contact/Groups/Computers connector.

caution

Testing is a great way to make sure you know what is happening.

Please try this on test data before trying on your production OU. You do not want to disable all accounts by mistake!

Then simply map your source columns to their corresponding target columns. You need to map your disabled/enabled column to DS-UAC-Disabled, where True will disable the account and False will enable the account.

info

DS- columns are Data Sync attribute columns that handle the addition of that field for each user.

Your schema map might look similar to the image below:

Schema Mapping

Now just run the compare and synchronise the changes. Your Active Directory user accounts will be enabled or disabled depending on your data.