Re: Decipher CFLDAP date values

2009-08-04 Thread Wally Randall

That formula is still not correct:

adexplorer shows this date:  7/2/2009 12:33:05 PM

cfldap returns this integer8 value: 128910259851092856

The coldfusion code shown below returns this date: January 07, 1601 09:47:01 
---

cfset sLDAPDate = 128910259851092856
cfset iLogonTime = left(sLDAPDate,4) * (2^32) + right(sLDAPDate,4)
cfset iLogonTime = iLogonTime / (60 * 1000) 
cfset iLogonTime = iLogonTime / 1440 
cfset iLogonTime = iLogonTime + createDateTime(1601,1,1,0,0,0)
cfoutput#dateFormat(iLogonTime, dd, )# 

~|
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:325196
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Decipher CFLDAP date values

2009-08-04 Thread Wally Randall

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 / 
(6),1/1/1601),now())
cfset passwordlastupdated = DateAdd(n, sLDAPDATE / (6),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


RE: Decipher CFLDAP date values

2009-08-03 Thread Dawson, Michael

http://cflib.org/udf/convertActiveDirectoryTime

  _  

From: Dave Phillips [mailto:experiencedcfdevelo...@gmail.com]
Sent: Fri 7/31/2009 10:34 PM
To: cf-talk
Subject: RE: Decipher CFLDAP date values




Wally,

I don't know if you figured this out yet or not, but using this page:

http://techtasks.com/code/viewbookcode/1607

And trying to convert that code to ColdFusion, I think I'm close, but not
quite there.  Here's what I have, maybe with this, you can figure it out (I
don't know what the correct date/time stamp actually is:

cfset sLDAPDate = 128922162522263907
cfset iLogonTime = left(sLDAPDate,4) * (2^32) + right(sLDAPDate,4)
cfset iLogonTime = iLogonTime / (60 * 1000) 
cfset iLogonTime = iLogonTime / 1440 
cfset iLogonTime = iLogonTime + createDateTime(1601,1,1,0,0,0)
cfoutput#dateFormat(iLogonTime, dd, )#
#timeFormat(iLogonTime,hh:mm:ss)#/cfoutput

Dave Phillips




~|
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:325179
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Decipher CFLDAP date values

2009-07-31 Thread Dave Watts

 When returning date/time values from active directory the CFLDAP tag provides 
 an
 integer value which must be decoded.  What is the formula for converting the 
 integer
 value to a human readable date?

 example:  LASTLOGON returns 128922162522263907

http://techtasks.com/code/viewbookcode/1607

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more informatio

~|
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:325157
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Decipher CFLDAP date values

2009-07-31 Thread Dave Phillips

Wally,

I don't know if you figured this out yet or not, but using this page:

http://techtasks.com/code/viewbookcode/1607

And trying to convert that code to ColdFusion, I think I'm close, but not
quite there.  Here's what I have, maybe with this, you can figure it out (I
don't know what the correct date/time stamp actually is:

cfset sLDAPDate = 128922162522263907
cfset iLogonTime = left(sLDAPDate,4) * (2^32) + right(sLDAPDate,4)
cfset iLogonTime = iLogonTime / (60 * 1000) 
cfset iLogonTime = iLogonTime / 1440 
cfset iLogonTime = iLogonTime + createDateTime(1601,1,1,0,0,0)
cfoutput#dateFormat(iLogonTime, dd, )#
#timeFormat(iLogonTime,hh:mm:ss)#/cfoutput

Dave Phillips

-Original Message-
From: Wally Randall [mailto:wally.rand...@comcast.net] 
Sent: Friday, July 31, 2009 3:31 PM
To: cf-talk
Subject: Decipher CFLDAP date values


When returning date/time values from active directory the CFLDAP tag
provides an integer value which must be decoded.  What is the formula for
converting the integer value to a human readable date?

example:  LASTLOGON returns 128922162522263907 



~|
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:325159
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4