Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting lastlogon to date from fileformat
Message
Information générale
Forum:
Windows
Catégorie:
Administration & Sécurité
Titre:
Converting lastlogon to date from fileformat
Divers
Thread ID:
00851951
Message ID:
00851951
Vues:
53
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
Répondre
Fil
Voir

Click here to load this message in the networking platform