Enable or Disable Active Directory User Account

To Enable or Disable a User Account in Active Directory you need to set the ACCOUNTDISABLE Flag in the UserAccountControl attribute.

To Enable or Disable a User Account in Active Directory you need to set the ACCOUNTDISABLE Flag in the UserAccountControl attribute.
You will need the existing value from the AD one way to do this is to use a Lookup back to the Target AD to bring in the values from the Target to the Source and then use Dynamic Columns to Set the Flag in UserAccountControl.
Use the Dynamic Columns code below to either Set or Clear the ACCOUNTDISABLE flag in UserAccountControl.

partial class DataSourceRowOverride : Simego.DataSync.DynamicColumns.DataSourceRowInternal //Do Not Change This Line { public int MyUserAccountControlEnable { get { return Lookup1_userAccountControl.Value & ~0x02; } } public int MyUserAccountControlDisable { get { return Lookup1_userAccountControl.Value | 0x02; } } }

Can't find the answers you're looking for? Contact our support team and we'll personally get back to you as quickly as we can.