Description : Ces informations précieuses nous renseignent sur la date de création, la date de la dernière modification pour une OU. Ce script permet justement d'afficher ces informations que l'on retrouve dans l'onglet "Objet" dans les propriétés d'une OU :
Script : Set objContainer = GetObject("GC://ou=Nom de l'OU,dc=Nom du domaine,dc=com") strWhenCreated = objContainer.Get("whenCreated") strWhenChanged = objContainer.Get("whenChanged") Set objUSNChanged = objContainer.Get("uSNChanged") dblUSNChanged = Abs(objUSNChanged.HighPart * 2^32 + objUSNChanged.LowPart) Set objUSNCreated = objContainer.Get("uSNCreated") dblUSNCreated = Abs(objUSNCreated.HighPart * 2^32 + objUSNCreated.LowPart) objContainer.GetInfoEx Array("canonicalName"), 0 arrCanonicalName = objContainer.GetEx("canonicalName") WScript.Echo "CanonicalName of object:" For Each strValue in arrCanonicalName WScript.Echo vbTab & strValue Next WScript.Echo WScript.Echo "Object class: " & objContainer.Class & vbCrLf WScript.Echo "whenCreated: " & strWhenCreated & " (Created - GMT)" WScript.Echo "whenChanged: " & strWhenChanged & " (Modified - GMT)" WScript.Echo VbCrLf WScript.Echo "uSNChanged: " & dblUSNChanged & " (USN Current)" WScript.Echo "uSNCreated: " & dblUSNCreated & " (USN Original)"
Proposer un script
|
Notre avis :

Votre avis :

Réactions : 0
Votants : 1
Visites : 12177
|