Latest Release
- Release candidate 2.0rc1 (23/12/11)
- Beta version 2.0 (06/07/11)
- Stable version 1.2.1 (15/07/10)
- Nightly builds available to test
Events
- 10/10/2011 - LDAPCon 2011 (Heidelberg, Germany)
- 13/06/2011 - RMLL (Strasbourg, France)
- 9/07/2010 - RMLL (Bordeaux, France)
Community
Get help, contribute or find professional services ...
Find out more!
Search
Download | Read more... | Get started!
Extended synchronization rules for Active DirectoryThe LSC has some built-in fonctions to interact with some specific attributes of an Active Directory. UserAccountControl (account type and status)This attribute is a set of bits to manage a user in an AD. You can access it in the normal way in LSC (dstBean.getAttributeValueById('userAccountControl')). Here are some methods to simplify changing values of this attribute. userAccountControlSetYou can set specific bits with the method AD.userAccountControlSet. This method takes 2 parameters :
For example: lsc.syncoptions.user.userAccountControl.default_value = \ AD.userAccountControlSet(\ dstBean.getAttributeValueById('userAccountControl'), \ [AD.UAC_UNSET_ACCOUNTDISABLE]) You can find a list of all the constants in the org.interldap.lsc.utils.directory.AD class. The constants are prefixed by UAC_SET and UAC_UNSET. Warning: to create an entry in AD, you can set userAccountControl field but the flag UAC_PASSWD_NOTREQD is mandatory if no password is submitted. So you can have a create_value like this: lsc.syncoptions.user.userAccountControl.create_value = \ AD.userAccountControlSet( "0", [ AD.UAC_SET_PASSWD_NOTREQD, \ AD.UAC_SET_NORMAL_ACCOUNT ]) userAccountControlCheckYou can check if a specific bit is set with the method AD.userAccountControlCheck. This method takes 2 parameters :
For example : AD.userAccountControlCheck(dstBean.getAttributeValueById('userAccountControl'), \ AD.UAC_ACCOUNTDISABLE) You can find a list of all the constants in the org.interldap.lsc.utils.directory.AD class. The constants are prefixed by UAC_ (without SET or UNSET after). userAccountControlToggleYou can toggle a specific bit with the method AD.userAccountControlToggle. This method takes 2 parameters :
For example : AD.userAccountControlToggle(dstBean.getAttributeValueById('userAccountControl'), \ AD.UAC_ACCOUNTDISABLE) You can find a list of all the constants in the org.interldap.lsc.utils.directory.AD class. The constants are prefixed by UAC_ (without SET or UNSET after). Managing passwordLSC enables creating and changing passwords for users. Here are some methods to simplify changing values of this attribute. getUnicodePwdThe getUnicodePwd method encodes a string to fit the syntax of the unicodePwd attribute in AD, used to set the password. So you can create a default password (e.g. “changeit”) for created users by setting: lsc.syncoptions.user.unicodePwd.action = K lsc.syncoptions.user.unicodePwd.create_value = AD.getUnicodePwd("changeit") Warnings and various pitfalls
Active Directory is, er, a little peculiar in it's handling of password changes. Checkout some Active Directory synchronization hints, to avoid being bitten by it's weird behaviour, like we have been Last logonActive Directory stores the date and time of the last logon to a server, in different attributes:
The format of these attributes is identical. It contains the timestamp of a user's last logon, with a variable precision. By default, this timestamp is only guaranteed to be updated every 2 weeks, but this is configurable. Beware when reading this value, and value that's less than 2 weeks old may just be due to the server imprecision. getNumberOfWeeksSinceLastLogonThe getNumberOfWeeksSinceLastLogon method takes the String value read from lastLogonTimestamp or lastLogon, and returns the number of weeks since the date recorded. This can be useful to detect unused accounts. For example: # Delete any accounts that haven't been used for 3 months or more
lsc.tasks.MyTask.condition.delete = \
AD.getNumberOfWeeksSinceLastLogon(srcBean.getAttributeValueById("lastLogon") > 12)
Account expiry dateTo set the Active Directory formatted value for an account expiry attribute, you can use the AD.getAccountExpires methods. |


