General information
Category:
Administration & Security
Title:
Converting lastlogon to date from fileformat
i need to convert the active directory value stored in "lastlogon" from the fileformat(? milliseconds since 1/1/1601) to the actual date and compare against another date parameter so i can determine which pc's in my active directory have been in use over a certain period of time. i have seen some examples but have been unable to get the conversion working properly. the error i get is
here is some code:
For Each searchResult In myResults
Response.Write("
-------------------------------------
")
Response.Write("")
Response.Write(searchResult.GetDirectoryEntry().Name.ToString)
Response.Write("
")
Dim propertyCollection As ResultPropertyCollection = searchResult.Properties
Dim propertyValueCollection As ResultPropertyValueCollection
Dim key As String
Dim lastlogon As DateTime
For Each key In propertyCollection.PropertyNames
Dim values As Object
For Each values In propertyCollection(key)
If key = "lastlogon" Then
Response.Write("" & key & " ")
Response.Write(values)
if Len(propertyCollection("lastlogon").ToString) > 0 Then
Dim oli As Object
oli = pcoll("lastlogon")(0)
fdt = (oli.HighPart * 4294967296) + (oli.lowpart)
Response.Write(fdt)
End If
End If
Next
Next
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only