La Référence Absolue sur les Technologies Microsoft




Afficher les informations de l'onglet Objet d'une OU

Accueil > Script > active_directory > Afficher les informations de l'onglet Objet d'une OU

Afficher les informations de l'onglet Objet d'une OU

Par Joachim GOMARD, LABORATOIRE SUPINFO DES TECHNOLOGIES MICROSOFT
Publiée le 21/10/2004 vers 19h.

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

1
2
3
4
5




Retrouvez ci-dessous les autres sections du Laboratoire Microsoft