|
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 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 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 -- From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Menten, Jeff 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,
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. |
Title: AD LDAP Data Conversion Question
