SOLVED:
This code shows how to translate the LDAP dates returned by ColdFusion tag 
cfldap and to determine the number of days since the password was last changed. 
It is based on code found on Scott Pinkston's blog:

http://www.scottpinkston.org/blog/index.cfm/2009/1/3/Detecting-password-age-from-either-Active-Directory-or-OpenLDAPSamba

<cfset sLDAPDate = "128910259851092856">
<cfset dayssinceupdate = dateDiff("d",DateAdd("n", sLDAPDATE / 
(600000000),"1/1/1601"),now())>
<cfset passwordlastupdated = DateAdd("n", sLDAPDATE / (600000000),"1/1/1601")>
<cfoutput>
dayssinceupdate: #dayssinceupdate#<br>
passwordlastupdated: #passwordlastupdated#
</cfoutput>

Results in:
dayssinceupdate: 32
passwordlastupdated: {ts '2009-07-02 17:33:00'} 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325198
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to