{"id":840,"date":"2012-06-23T22:24:03","date_gmt":"2012-06-23T22:24:03","guid":{"rendered":"https:\/\/pipe2text.com\/?page_id=840"},"modified":"2012-06-23T22:50:53","modified_gmt":"2012-06-23T22:50:53","slug":"using-powershell-3-0-and-active-directory-replication-metadata-to-view-changes-in-active-directory-objects","status":"publish","type":"page","link":"https:\/\/pipe2text.com\/?page_id=840","title":{"rendered":"Using PowerShell 3.0 and Active Directory Replication Metadata to view changes in Active Directory Objects"},"content":{"rendered":"<p>Hi All,<\/p>\n<p>In this blog I will be writing about a PowerShell cmdlet that is included in the Active Directory Module included in the RSAT Tools for Windows 8. Active Directory stores Replication metadata which contains information\u00a0about changes to\u00a0Active Directory object&#8217;s attributes such as the version, which domain controller the change originated, and when they\u00a0were changed last. I&#8217;ve used this information plenty of times when trying to trying to track down what happened when there is some sort of unexplained change to an object such as a user or group.<\/p>\n<p>The cmdlet used to find this information is the &#8220;Get-ADReplicationAttributeMetadata&#8221; cmdlet. You will need to have the Active Directory Module for PowerShell included in the RSAT for Windows 8\/ Windows 2012 installed to use the cmdlet.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Example 1<\/strong><\/span><\/p>\n<p>In\u00a0the following\u00a0example I will be viewing the Active Directory Replication\u00a0Metadata to view changes to the membership of the Domain Admins group in the Pipe2text domain. After running this command you will be able to see who was added or removed from the group and when it happened.<\/p>\n<p><strong>The Command<\/strong><\/p>\n<p>Get-ADReplicationAttributeMetadata &#8220;CN=Domain Admins,CN=Users,DC=pipe2text,DC=com&#8221; -ShowAllLinkedValues -Server <em>mydomaincontroller<\/em> -property member<\/p>\n<p>All you will need to do is replace the distinguished name with the distiguishedname of the group you want to look at and <em>mydomaincontroller<\/em> with the name of the Domain Controller you want to query.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Example 2<\/strong><\/span><\/p>\n<p>In this next example you can view when changes happened to attributes for an Active Directory user object. We will be looking at user BC in the &#8220;WhereIKeepMyUsers&#8221; OU on the Pipe2text.com domain.<\/p>\n<p><strong>The Command<\/strong><\/p>\n<p>Get-ADReplicationAttributeMetadata &#8220;CN=BC,OU=WhereIKeepMyUsers,DC=pipe2text,DC=com&#8221; -ShowAllLinkedValues -Server <em>mydomaincontroller<\/em><\/p>\n<p><strong>You should receive the following output for each attribute change:<\/strong><\/p>\n<p>Server Version<\/p>\n<p>AttributeName AttributeValue<\/p>\n<p>FirstOriginatingCreateTime IsLinkValue LastOriginatingChangeDirectoryServerIdentity<\/p>\n<p>LastOriginatingChangeDirectoryServerInvocationId LastOriginatingChangeTime LastOriginatingChangeUsn LastOriginatingDeleteTime LocalChangeUsn Object<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Example 3<\/strong><\/span><\/p>\n<p>Now lets say you dont need all of that data and want to format it a little nicer. For example, you wanted to only list the attribute name, lastorignatingtime andLastOriginatingChangeDirectoryServerIdentity sorting the list by lastoriginatingchangetime you could run the following:<\/p>\n<p><strong>The Command<\/strong><\/p>\n<p>Get-ADReplicationAttributeMetadata &#8220;CN=BC,OU=WhereIKeepMyUsers,DC=pipe2text,DC=com&#8221; -ShowAllLinkedValues -Server <em>mydomaincontroller<\/em> | sort lastoriginatingchangetime | select attributename,lastoriginatingchangetime,LastOriginatingChangeDirectoryServerIdentity<\/p>\n<p>You will now get a nicely formatted list sorted by the attribute change times.<\/p>\n<p>The above is just two examples of how the &#8220;Get-ADReplicationAttributeMetadata&#8221; cmdlet can be used to find valuable information in Active Directory Replication Metadata. There are many other ways that this cmdlet can be used to find other useful information. For more information on using this cmdlet \u00a0you can simply type &#8220;Get-Help Get-ADReplicationAttributeMetadata&#8221; and read the help file. Hope this helps. If you have any questions or feedback\u00a0please leave a comment. Thanks.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi All, In this blog I will be writing about a PowerShell cmdlet that is included in the Active Directory Module included in the RSAT Tools for Windows 8. Active Directory stores Replication metadata which contains information\u00a0about changes to\u00a0Active Directory &hellip; <a href=\"https:\/\/pipe2text.com\/?page_id=840\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"class_list":["post-840","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/840","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=840"}],"version-history":[{"count":20,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/840\/revisions"}],"predecessor-version":[{"id":855,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/840\/revisions\/855"}],"wp:attachment":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}