Returns information found on the Object page in Active Directory Users and Computers for the Sales OU.
Set objContainer = GetObject _("GC://ou=Sales,dc=NA,dc=fabrikam,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"), 0arrCanonicalName = objContainer.GetEx("canonicalName")WScript.echo "CanonicalName of object:"For Each strValue in arrCanonicalNameWScript.echo vbTab & strValueNextWScript.Echo vbCrWScript.Echo "Object class: " & objContainer.Class & vbCrLfWScript.echo "whenCreated: " & strWhenCreated & " (Created - GMT)"WScript.echo "whenChanged: " & strWhenChanged & " (Modified - GMT)"WScript.Echo VbCrLfWScript.Echo "uSNChanged: " & dblUSNChanged & " (USN Current)"WScript.Echo "uSNCreated: " & dblUSNCreated & " (USN Original)"
This is a VB Script, this can be used by saving the file in .vbs file