Title: AD LDAP Data Conversion Question

FWIW, in .NET, you just the get value from the DirectorySearcher’s SearchResult as Int64 and pass that to DateTime.FromFileTime(…).  When using the DirectoryEntry, slightly more jumping through hoops must be done, but it works too.

 

That works for any INTEGER8 value in AD that stores a FILETIME unless it is set to 0 or -1.  In those cases, it isn’t a valid datetime, so you must proceed accordingly.

 

Joe K.

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of joe
Sent: Wednesday, October 27, 2004 3:12 PM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] AD LDAP Data Conversion Question

 

Yep, barring using pwdLastSet you can use lastLogonTimeStamp if in a 2K3 forest at the correct functional mode.

 

I believe Robbie Allen posted a script on his website for doing this conversion also but if I recall there were possible issues with it not always coming out with the correct value but it has been a while since I poked into it. I think I wrote something to do this as well in perl but it depends on having access to the ctime function.

 

From vbscript, I would hunt down stuff by Richard Mueller, he would have the method to do it if there is one available for vbscript.

 

  joe

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Al Lilianstrom
Sent: Wednesday, October 27, 2004 12:32 PM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] AD LDAP Data Conversion Question

The pwdlastset attribute should give you what you want for computer accounts. This was just discussed in the last week or so on this list.

 

Check the oldcmp tool from joeware.net - http://www.joeware.net/win/free/tools/oldcmp.htm to be exact. It'll do this (and more) and give you a usable report. If you want to do it on your own with perl I have a snippet that will convert the number in pwdlastset to a date.

 

    al

--

Al Lilianstrom
CD/CSS/CSI
[EMAIL PROTECTED]

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Menten, Jeff
Sent: Wednesday, October 27, 2004 10:23 AM
To: [EMAIL PROTECTED]
Subject: [ActiveDir] AD LDAP Data Conversion Question

All,

I would like to extract the "lastLogon" value from AD to check for orphan workstations, etc. This attribute has an INTEGER8 format - which, as far as I can tell, is an eight-byte data structure. Does anyone know of an easy way to convert this value via VBscript to a readable format that will actually print?

Thanks,
        - Jeff M.


 
 
___________________________________________________________________________
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is
for the sole use of the intended recipient(s) and may contain confidential
and privileged information.  Any unauthorized review, use, disclosure or
distribution is prohibited.  If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original
message.

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.

Reply via email to