Emeric, can you write javascript?  Instead of just setting the value 
between your string tags, write a simple javascript if block that only 
sets the field if it's not the default value.

-Jon C. Kidder
American Electric Power
Middleware Services
614-716-4970



Emeric Million <[email protected]> 
Sent by: [email protected]
02/06/2013 06:04 AM

To
lsc-userslsc-users <[email protected]>
cc

Subject
[lsc-users] convert AD expireAccount to LDAP shadowExpire






Hello.
I'm trying to convert AD expireAccount (wich is 100 nano second from 1601) 
to shadowExpire (which is the number of day from 1970). For a sync from an 
AD to an OpenLDAP.
 
I found the aDTimeToUnixTimestamp function. It work well when there is an 
"Expire Date Account". However, the default value for "Never Expire" in AD 
is "9223372036854775807" and with this function I end up with a date like 
23.1.1975.
 
My question is : is there a way to let empty the shadowExpire if the 
expireAccount is "9223372036854775807" ?
 
My lsc dataset :
 
        <dataset>
                <name>shadowExpire</name>
                <policy>FORCE</policy>
                <forceValues>
                        
<string>js:(AD.aDTimeToUnixTimestamp(srcBean.getDatasetFirstValueById("accountExpires"))/86400).toFixed(0)</string>
                </forceValues>
        </dataset>
 
Examples of users' values
user 1 :
  AD : 129915360000000000
  LDAP : 15591
  Date LDAP : 8.9.2012
 
 
user2 :
 AD : 9223372036854775807
 LDAP : 1848
 Date LDAP : 23.1.1975
 
The only solution I see for now is to create an other task to update the 
shadowExpire and put a condition for this task like this :
 
<conditions>
  <create>false</create>
  <update>srcBean.getDatasetFirstValueById("accountExpires") &lt; 
9223372036854775807</update>
  <delete>false</delete>
  <changeId>false</changeId>
</conditions>
 
Is there a better way ?
 
Thanks !
 
Source and usefull links : 
http://lsc-project.org/javadoc/2.0-SNAPSHOT/org/lsc/utils/directory/AD.html#aDTimeToUnixTimestamp(long
)
http://msdn.microsoft.com/en-us/library/windows/desktop/ms675098(v=vs.85).aspx
http://timestamp.ooz.ie/p/ad.html



 
MILLION Emeric
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users

_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users

Reply via email to