4.22.1 ProblemYou want to determine when an object was either created or last updated. 4.22.2 Solution4.22.2.1 Using a graphical user interface
4.22.2.2 Using a command-line interface> dsquery * "<ObjectDN>" -attr name createTimestamp modifyTimestamp 4.22.2.3 Using VBScript' This code prints the created and last modified timestamp ' for the specified object. ' ------ SCRIPT CONFIGURATION ------ strObjectDN = "<ObjectDN>" ' ------ END CONFIGURATION --------- set objEntry = GetObject("LDAP://" & strObjectDN) Wscript.Echo "Object Name: " & objEntry.Get("name") Wscript.Echo " Created: " & objEntry.Get("createTimestamp") Wscript.Echo " Changed: " & objEntry.Get("modifyTimestamp") 4.22.3 DiscussionWhen an object is created or modified in Active Directory, the createTimestamp and modifyTimestamp attributes get set with the current time. Those two attributes are replicated, so assuming the latest modification of the object in question has replicated to all domain controllers, they will contain the absolute create and last modified timestamps. You may have also run across the whenCreated and whenChanged attributes. They also contain create and modify timestamps, but these values are local to the domain controller and are not replicated. 4.22.4 See AlsoRecipe 4.2 for viewing the attributes of an object |