{"id":109,"date":"2014-07-02T15:17:42","date_gmt":"2014-07-02T19:17:42","guid":{"rendered":"http:\/\/blog.metcorp.org\/?p=109"},"modified":"2014-06-09T21:53:11","modified_gmt":"2014-06-10T01:53:11","slug":"powershell-get-the-dates-when-the-active-directory-schema-was-updated","status":"publish","type":"post","link":"https:\/\/adsecurity.org\/?p=109","title":{"rendered":"PowerShell: Get the Dates When the Active Directory Schema Was Updated"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>The Microsoft Scripting Guys blog has a g<a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2012\/01\/05\/how-to-find-active-directory-schema-update-history-by-using-powershell.aspx\">reat article on determining when schema updates were performed along with some information about the schema changes<\/a> &#8211; at least enough to see if it was an Exchange update.<\/p>\n<p>&nbsp;<\/p>\n<p><code><br \/>\n###########################<br \/>\n# Get Schema Update Dates #<br \/>\n###########################<br \/>\n# Code from: http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2012\/01\/05\/how-to-find-active-directory-schema-update-history-by-using-powershell.aspx<br \/>\nwrite-output \"Reading all schema data... \" `r<br \/>\nimport-module activedirectory<br \/>\n$schema = Get-ADObject -SearchBase ((Get-ADRootDSE).schemaNamingContext) `<br \/>\n-SearchScope OneLevel -Filter * -Property objectClass, name, whenChanged,`<br \/>\nwhenCreated | Select-Object objectClass, name, whenCreated, whenChanged, `<br \/>\n@{name=\"event\";expression={($_.whenCreated).Date.ToShortDateString()}} | `<br \/>\nSort-Object whenCreated<\/p>\n<p>#\"`nDetails of schema objects changed by date:\"<br \/>\n#$schema | Format-Table objectClass, name, whenCreated, whenChanged `<br \/>\n#-GroupBy event -AutoSize<\/p>\n<p>write-output \"`nCount of schema objects changed by date:\" `r<br \/>\nWrite-output \"This displays the approximate date each each schema update was performed.\" `r<br \/>\n$schema | Group-Object event | Format-Table Count,Name,Group \u2013AutoSize<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; The Microsoft Scripting Guys blog has a great article on determining when schema updates were performed along with some information about the schema changes &#8211; at least enough to see if it was an Exchange update. &nbsp; ########################### # Get Schema Update Dates # ########################### # Code from: http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2012\/01\/05\/how-to-find-active-directory-schema-update-history-by-using-powershell.aspx write-output &#8220;Reading all schema data&#8230; &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/adsecurity.org\/?p=109\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[34,38,40,22],"class_list":["post-109","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-adschema","tag-getadobject","tag-getadrootdse","tag-powershellcode","item-wrap"],"_links":{"self":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=109"}],"version-history":[{"count":1,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":110,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/109\/revisions\/110"}],"wp:attachment":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}