I wanted to find out what date an Active Directory object was created on / replicated to a Domain Controller.
Actually, you can find that information in the meta-data of the Active Directory Object!
Index
Access the Meta-Data of an AD object
You can access it with the tool “repadmin” as described by Jens in the article about
Tracking changes of Active Directory objects
Look at the change date of the attribute “cn” of the AD object. It shows the date the Active Directory Object was created on which Domain Controller.
Exception: The attribute “cn” was changed afterwards.
The following Powershell script does the work all by itself.
PowerShell script to find out when an Active Directory Object was created / replicated
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
add-PSSnapin "Quest.ActiveRoles.ADManagement" -ErrorAction:SilentlyContinue $userName = "waniert" Connect-QADService "firstattribute.com" $user = Get-QADUser -SamAccountName $userName -Service $dc.dNSHostName $distinghuishedName = $user.DN $domainControllers = Get-QADComputer -ComputerRole:DomainController foreach($dc in $domainControllers) { $result = repadmin /showmeta "$distinghuishedName" $dc.dNSHostName foreach( $line in $result) { if($line.ToString().EndsWith("cn")) { $line } } } |
1 2 3 4 5 6 7 8 9 10 11 12 |
6320129 NA-USWYA-S\<span style="color: #ff0000;"><strong>DC01 </strong></span> 6320129 <span style="color: #ff0000;"><strong>2014-01-25 15:30:00 </strong></span> 2 cn 7189501 NA-USTAZ-S\<span style="color: #ff0000;"><strong>DC02 </strong></span> 7189501 <span style="color: #ff0000;"><strong>2014-01-25 15:37:37</strong></span> 2 cn 8879711 EU-ESTAR-S\<span style="color: #ff0000;"><strong>DC03 </strong></span> 8879711 <span style="color: #ff0000;"><strong>2014-01-25 15:20:20</strong></span> 2 cn 8053118 EU-GBCDH-S\<span style="color: #ff0000;"><strong>DC04 </strong></span> 8053118 <span style="color: #ff0000;"><strong>2014-01-25 15:23:53</strong></span> 3 cn 7105090 NA-USNPD-S\<span style="color: #ff0000;"><strong>DC05 </strong></span> 7105090 <span style="color: #ff0000;"><strong>2014-01-25 15:29:21 </strong></span> 2 cn 6878828 NA-USZGF-S\<span style="color: #ff0000;"><strong>DC06 </strong></span> 6878828 <span style="color: #ff0000;"><strong>2014-01-25 15:30:07 </strong></span> 2 cn 8759518 AP-SGSIN-H\<span style="color: #ff0000;"><strong>DC07 </strong></span> 8759518 <span style="color: #ff0000;"><strong>2014-01-25 15:28:24 </strong></span> 2 cn 7026860 EU-FRCGI-S\<span style="color: #ff0000;"><strong>DC08 </strong></span> 7026860 <span style="color: #ff0000;"><strong>2014-01-25 15:23:20 </strong></span> 2 cn 6767427 NA-USFP2-S\<span style="color: #ff0000;"><strong>DC09 </strong></span> 6767427 <span style="color: #ff0000;"><strong>2014-01-25 15:30:07 </strong></span> 2 cn 9178276 NA-USAND-H\<span style="color: #ff0000;"><strong>DC10</strong></span> 9178276 <span style="color: #ff0000;"><strong>2014-01-25 15:24:01 </strong></span> 2 cn 1164979 EU-DELUH-H\<span style="color: #ff0000;"><strong>DC11 </strong></span> 1164979 <span style="color: #ff0000;"><strong>2014-01-27 11:19:30 </strong></span> 1 cn 34002699 EU-DELUH-H\<span style="color: #ff0000;"><strong>DC12 </strong></span> 34002699 <span style="color: #ff0000;"><strong>2014-01-25 15:19:13 </strong></span> 3 cn |
Leave a Reply
<p>Your email is safe with us.<br/>Information about our <a href="https://activedirectoryfaq.com/contact-us/">data protection policies</a></p>