{"id":1414,"date":"2014-06-22T23:06:57","date_gmt":"2014-06-22T15:06:57","guid":{"rendered":"http:\/\/www.jhouseconsulting.com\/?p=1414"},"modified":"2015-01-03T03:06:16","modified_gmt":"2015-01-02T19:06:16","slug":"script-to-create-an-active-directory-schema-update-report","status":"publish","type":"post","link":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/2014\/06\/22\/script-to-create-an-active-directory-schema-update-report-1414","title":{"rendered":"Script to Create an Active Directory Schema Update Report"},"content":{"rendered":"<p>This PowerShell script was written by the awesome <a href=\"http:\/\/blogs.technet.com\/b\/ashleymcglone\/\" target=\"_blank\">Ashley McGlone<\/a> (AKA <a href=\"https:\/\/twitter.com\/GoateePFE\" target=\"_blank\">Goatee PFE<\/a>) and published to the TechNet Script Center. It was also blogged on the Scriting Guy TechNet site. However, it did need some updates to keep up with the newer schema updates as well as adding the SCCM (ConfigMgr) versions. As Ashley has not updated it since 19th September 2013 I thought I&#8217;d update it myself and post it here until he gets the time to update the script and publish an updated version.<\/p>\n<p>It will report the versions of the following products as per the sample screen shot from one of my customers:<\/p>\n<ul>\n<li>Active Directory<\/li>\n<li>Exchange<\/li>\n<li>Lync<\/li>\n<li>System Center Configuration Manager (SCCM) &#8211; ConfigMgr<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-content\/uploads\/2014\/06\/Schema-Version-of-Products.png\"><img decoding=\"async\" class=\"aligncenter wp-image-1438 size-full\" title=\"Schema Version of Products\" src=\"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-content\/uploads\/2014\/06\/Schema-Version-of-Products.png\" alt=\"Schema Version of Products\" width=\"376\" height=\"103\" srcset=\"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-content\/uploads\/2014\/06\/Schema-Version-of-Products.png 376w, https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-content\/uploads\/2014\/06\/Schema-Version-of-Products-300x82.png 300w\" sizes=\"(max-width: 376px) 100vw, 376px\" \/><\/a><\/p>\n<p>Please ensure you read the Scripting Guy&#8217;s blog titled &#8220;<a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2012\/01\/05\/how-to-find-active-directory-schema-update-history-by-using-powershell.aspx\" target=\"_blank\">How to Find Active Directory Schema Update History by Using PowerShell<\/a>&#8220;, which provides some great documentation on the script as well as some valuable comments that have helped\u00a0to implement the updates.<\/p>\n<p>The original script can be found here on the\u00a0TechNet Script Center: <a href=\"http:\/\/gallery.technet.microsoft.com\/scriptcenter\/PowerShell-Active-4ffedca4\" target=\"_blank\">PowerShell Active Directory Schema Update Report<\/a><!--more--><\/p>\n<p>Here is the <a href=\"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-content\/uploads\/2014\/06\/Get-ADSchemaReport.ps1_.txt\" target=\"_blank\">Get-ADSchemaReport.ps1<\/a>\u00a0script:<\/p>\n<pre class=\"brush: powershell; auto-links: false; title: ; toolbar: false; notranslate\" title=\"\">\r\n&lt;#-----------------------------------------------------------------------------\r\nHow to find AD schema update history using PowerShell\r\nAshley McGlone, Microsoft Premier Field Engineer\r\nhttp:\/\/blogs.technet.com\/b\/ashleymcglone\r\nDecember, 2011\r\n\r\nThis script reports on schema update and version history for Active Directory.\r\nIt requires the ActiveDirectory module to run.\r\nIt makes no changes to the environment.\r\n\r\nUPDATED:\r\n2013-03-12  Added Windows Server 2012, Exchange 2010 SP3 &amp; 2013, Lync 2013\r\n2013-09-19  Added Windows Server 2012 R2\r\n            Added OID for schema attributes\r\n            Added schema.csv output\r\n            Sorted output\r\n2014-06-12  Added Exchange 2013 SP1 as documented in the comments on the Scripting Guy blog\r\n            Added SCCM as documented in the comments on the Scripting Guy blog\r\n            http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2012\/01\/05\/how-to-find-active-directory-schema-update-history-by-using-powershell.aspx\r\n2014-06-24  Added Exchange 2013 cumulative update versions as per feedback\r\n            http:\/\/supertekboy.com\/2014\/05\/01\/check-exchange-schema-objects-adsi-edit\/\r\n            <blockquote class=\"wp-embedded-content\" data-secret=\"wej4iKQdSl\"><a href=\"https:\/\/bhargavs.com\/index.php\/2009\/11\/20\/verify-exchange-server-schema-version\/\">Verify Exchange Server Schema Version<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Verify Exchange Server Schema Version&#8221; &#8212; Bhargav&#039;s IT Playground\" src=\"https:\/\/bhargavs.com\/index.php\/2009\/11\/20\/verify-exchange-server-schema-version\/embed\/#?secret=2wtgNWvgHY#?secret=wej4iKQdSl\" data-secret=\"wej4iKQdSl\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\r\n\r\nReferences for schema values:\r\nhttp:\/\/support.microsoft.com\/kb\/556086?wa=wsignin1.0\r\nhttp:\/\/social.technet.microsoft.com\/wiki\/contents\/articles\/2772.exchange-schema-versions-common-questions-answers.aspx\r\nhttp:\/\/technet.microsoft.com\/en-us\/library\/gg412822.aspx\r\n\r\nLEGAL DISCLAIMER\r\nThis Sample Code is provided for the purpose of illustration only and is not\r\nintended to be used in a production environment.  THIS SAMPLE CODE AND ANY\r\nRELATED INFORMATION ARE PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND, EITHER\r\nEXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF\r\nMERCHANTABILITY AND\/OR FITNESS FOR A PARTICULAR PURPOSE.  We grant You a\r\nnonexclusive, royalty-free right to use and modify the Sample Code and to\r\nreproduce and distribute the object code form of the Sample Code, provided\r\nthat You agree: (i) to not use Our name, logo, or trademarks to market Your\r\nsoftware product in which the Sample Code is embedded; (ii) to include a valid\r\ncopyright notice on Your software product in which the Sample Code is embedded;\r\nand (iii) to indemnify, hold harmless, and defend Us and Our suppliers from and\r\nagainst any claims or lawsuits, including attorneys\u2019 fees, that arise or result\r\nfrom the use or distribution of the Sample Code.\r\n\r\nThis posting is provided &quot;AS IS&quot; with no warranties, and confers no rights. Use\r\nof included script samples are subject to the terms specified\r\nat http:\/\/www.microsoft.com\/info\/cpyright.htm.\r\n-----------------------------------------------------------------------------#&gt;\r\n\r\nImport-Module ActiveDirectory \r\n\r\n$schema = Get-ADObject -SearchBase ((Get-ADRootDSE).schemaNamingContext) `\r\n    -SearchScope OneLevel -Filter * -Property objectClass, name, whenChanged,`\r\n    whenCreated, attributeID | Select-Object objectClass, attributeID, name,`\r\n    whenCreated, whenChanged, `\r\n    @{name=&quot;event&quot;;expression={($_.whenCreated).Date.ToString(&quot;yyyy-MM-dd&quot;)}} |\r\n    Sort-Object event, objectClass, name\r\n\r\n&quot;`nDetails of schema objects created by date:&quot;\r\n$schema | Format-Table objectClass, attributeID, name, whenCreated, whenChanged `\r\n    -GroupBy event -AutoSize\r\n\r\n&quot;`nCount of schema objects created by date:&quot;\r\n$schema | Group-Object event | Format-Table Count, Name, Group -AutoSize\r\n\r\n$schema | Export-CSV .\\schema.csv -NoTypeInformation\r\n&quot;`nSchema CSV output here: .\\schema.csv&quot;\r\n\r\n#------------------------------------------------------------------------------\r\n\r\n&quot;`nForest domain creation dates:&quot;\r\nGet-ADObject -SearchBase (Get-ADForest).PartitionsContainer `\r\n    -LDAPFilter &quot;(&amp;(objectClass=crossRef)(systemFlags=3))&quot; `\r\n    -Property dnsRoot, nETBIOSName, whenCreated |\r\n  Sort-Object whenCreated |\r\n  Format-Table dnsRoot, nETBIOSName, whenCreated -AutoSize\r\n\r\n#------------------------------------------------------------------------------\r\n\r\n$SchemaVersions = @()\r\n\r\n$SchemaHashAD = @{\r\n    13=&quot;Windows 2000 Server&quot;;\r\n    30=&quot;Windows Server 2003 RTM&quot;;\r\n    31=&quot;Windows Server 2003 R2&quot;;\r\n    44=&quot;Windows Server 2008 RTM&quot;;\r\n    47=&quot;Windows Server 2008 R2&quot;;\r\n    56=&quot;Windows Server 2012 RTM&quot;;\r\n    69=&quot;Windows Server 2012 R2&quot;\r\n    }\r\n\r\n$SchemaPartition = (Get-ADRootDSE).NamingContexts | Where-Object {$_ -like &quot;*Schema*&quot;}\r\n$SchemaVersionAD = (Get-ADObject $SchemaPartition -Property objectVersion).objectVersion\r\n$SchemaVersions += 1 | Select-Object `\r\n    @{name=&quot;Product&quot;;expression={&quot;AD&quot;}}, `\r\n    @{name=&quot;Schema&quot;;expression={$SchemaVersionAD}}, `\r\n    @{name=&quot;Version&quot;;expression={$SchemaHashAD.Item($SchemaVersionAD)}}\r\n\r\n#------------------------------------------------------------------------------\r\n\r\n$SchemaHashExchange = @{\r\n    4397=&quot;Exchange Server 2000 RTM&quot;;\r\n    4406=&quot;Exchange Server 2000 SP3&quot;;\r\n    6870=&quot;Exchange Server 2003 RTM or SP1 or SP2&quot;;\r\n    6936=&quot;Exchange Server 2003 SP3&quot;;\r\n    10637=&quot;Exchange Server 2007 RTM&quot;;\r\n    11116=&quot;Exchange 2007 SP1&quot;;\r\n    14622=&quot;Exchange 2007 SP2 or Exchange 2010 RTM&quot;;\r\n    14625=&quot;Exchange 2007 SP3&quot;;\r\n    14726=&quot;Exchange 2010 SP1&quot;;\r\n    14732=&quot;Exchange 2010 SP2&quot;;\r\n    14734=&quot;Exchange 2010 SP3&quot;;\r\n    15137=&quot;Exchange 2013 RTM&quot;;\r\n    15254=&quot;Exchange 2013 CU1&quot;;\r\n    15281=&quot;Exchange 2013 CU2&quot;;\r\n    15283=&quot;Exchange 2013 CU3&quot;;\r\n    15292=&quot;Exchange 2013 SP1&quot;\r\n    }\r\n\r\n$SchemaPathExchange = &quot;CN=ms-Exch-Schema-Version-Pt,$SchemaPartition&quot;\r\nIf (Test-Path &quot;AD:$SchemaPathExchange&quot;) {\r\n    $SchemaVersionExchange = (Get-ADObject $SchemaPathExchange -Property rangeUpper).rangeUpper\r\n} Else {\r\n    $SchemaVersionExchange = 0\r\n}\r\n\r\n$SchemaVersions += 1 | Select-Object `\r\n    @{name=&quot;Product&quot;;expression={&quot;Exchange&quot;}}, `\r\n    @{name=&quot;Schema&quot;;expression={$SchemaVersionExchange}}, `\r\n    @{name=&quot;Version&quot;;expression={$SchemaHashExchange.Item($SchemaVersionExchange)}}\r\n\r\n#------------------------------------------------------------------------------\r\n\r\n$SchemaHashLync = @{\r\n    1006=&quot;LCS 2005&quot;;\r\n    1007=&quot;OCS 2007 R1&quot;;\r\n    1008=&quot;OCS 2007 R2&quot;;\r\n    1100=&quot;Lync Server 2010&quot;;\r\n    1150=&quot;Lync Server 2013&quot;\r\n    }\r\n\r\n$SchemaPathLync = &quot;CN=ms-RTC-SIP-SchemaVersion,$SchemaPartition&quot;\r\nIf (Test-Path &quot;AD:$SchemaPathLync&quot;) {\r\n    $SchemaVersionLync = (Get-ADObject $SchemaPathLync -Property rangeUpper).rangeUpper\r\n} Else {\r\n    $SchemaVersionLync = 0\r\n}\r\n\r\n$SchemaVersions += 1 | Select-Object `\r\n    @{name=&quot;Product&quot;;expression={&quot;Lync&quot;}}, `\r\n    @{name=&quot;Schema&quot;;expression={$SchemaVersionLync}}, `\r\n    @{name=&quot;Version&quot;;expression={$SchemaHashLync.Item($SchemaVersionLync)}}\r\n\r\n#------------------------------------------------------------------------------\r\n\r\n$SchemaHashSCCM = @{\r\n    &quot;4.00.5135.0000&quot;=&quot;SCCM 2007 Beta 1&quot;;\r\n    &quot;4.00.5931.0000&quot;=&quot;SCCM 2007 RTM&quot;;\r\n    &quot;4.00.6221.1000&quot;=&quot;SCCM 2007 SP1\/R2&quot;;\r\n    &quot;4.00.6221.1193&quot;=&quot;SCCM 2007 SP1 (KB977203)&quot;;\r\n    &quot;4.00.6487.2000&quot;=&quot;SCCM 2007 SP2&quot;;\r\n    &quot;4.00.6487.2111&quot;=&quot;SCCM 2007 SP2 (KB977203)&quot;;\r\n    &quot;4.00.6487.2157&quot;=&quot;SCCM 2007 R3&quot;;\r\n    &quot;4.00.6487.2207&quot;=&quot;SCCM 2007 SP2 (KB2750782)&quot;;\r\n    &quot;5.00.7561.0000&quot;=&quot;SCCM 2012 Beta 2&quot;;\r\n    &quot;5.00.7678.0000&quot;=&quot;SCCM 2012 RC1&quot;;\r\n    &quot;5.00.7703.0000&quot;=&quot;SCCM 2012 RC2&quot;;\r\n    &quot;5.00.7711.0000&quot;=&quot;SCCM 2012 RTM&quot;;\r\n    &quot;5.00.7711.0200&quot;=&quot;SCCM 2012 CU1&quot;;\r\n    &quot;5.00.7711.0301&quot;=&quot;SCCM 2012 CU2&quot;;\r\n    &quot;5.00.7782.1000&quot;=&quot;SCCM 2012 SP1 Beta&quot;;\r\n    &quot;5.00.7804.1000&quot;=&quot;SCCM 2012 SP1&quot;;\r\n    &quot;5.00.7804.1202&quot;=&quot;SCCM 2012 SP1 CU1&quot;;\r\n    &quot;5.00.7804.1300&quot;=&quot;SCCM 2012 SP1 CU2&quot;;\r\n    &quot;5.00.7804.1400&quot;=&quot;SCCM 2012 SP1 CU3&quot;;\r\n    &quot;5.00.7804.1500&quot;=&quot;SCCM 2012 SP1 CU4&quot;;\r\n    &quot;5.00.7958.1000&quot;=&quot;SCCM 2012 R2&quot;\r\n    }\r\n\r\n$SchemaPathSCCM = &quot;CN=System Management,&quot; + (Get-ADDomain).SystemsContainer\r\nif (Test-Path &quot;AD:$SchemaPathSCCM&quot;) {\r\n  $SCCMData = Get-ADObject -SearchBase (&quot;CN=System Management,&quot; + (Get-ADDomain).SystemsContainer) -LDAPFilter &quot;(&amp;(objectClass=mSSMSManagementPoint))&quot; -Property mSSMSCapabilities,mSSMSMPName\r\n  if ($sccmdata -isnot &#x5B;system.Array]) {\r\n    $SCCMxml = &#x5B;XML]$SCCMdata.mSSMSCapabilities\r\n    $schemaVersionSCCM = $SCCMxml.ClientOperationalSettings.Version\r\n  } else {\r\n    $schemaVersionSCCMList = Foreach($SCCMINstance in 0..($SCCMData.count -1)) {\r\n      $SCCMxml = &#x5B;XML]$SCCMdata&#x5B;$SCCMInstance].mSSMSCapabilities\r\n      $SCCMxml.ClientOperationalSettings.Version\r\n      }\r\n    $SchemaVersionSCCM = $schemaVersionSCCMList|Sort-Object -Descending|Select-Object -First 1\r\n  }\r\n} Else {\r\n  $schemaVersionSCCM = 0\r\n}\r\n\r\n$SchemaVersions += 1 | Select-Object `\r\n    @{name=&quot;Product&quot;;expression={&quot;SCCM&quot;}}, `\r\n    @{name=&quot;Schema&quot;;expression={$schemaVersionSCCM}}, `\r\n    @{name=&quot;Version&quot;;expression={$SchemaHashSCCM.Item($schemaVersionSCCM)}}\r\n\r\n#------------------------------------------------------------------------------\r\n\r\n&quot;`nKnown current schema version of products:&quot;\r\n$SchemaVersions | Format-Table * -AutoSize\r\n\r\n#---------------------------------------------------------------------------sdg\r\n<\/pre>\n<p>Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This PowerShell script was written by the awesome Ashley McGlone (AKA Goatee PFE) and published to the TechNet Script Center. It was also blogged on the Scriting Guy TechNet site. However, it did need some updates to keep up with the newer schema updates as well as adding the SCCM (ConfigMgr) versions. As Ashley has &#8230; <a title=\"Script to Create an Active Directory Schema Update Report\" class=\"read-more\" href=\"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/2014\/06\/22\/script-to-create-an-active-directory-schema-update-report-1414\" aria-label=\"Read more about Script to Create an Active Directory Schema Update Report\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[202,5],"tags":[428,284,337,365,362,364,341,340,360,363,359,361,7,64],"class_list":["post-1414","post","type-post","status-publish","format-standard","hentry","category-active-directory","category-scripting","tag-active-directory","tag-ad","tag-adds","tag-configmgr","tag-exchange","tag-lync","tag-posh","tag-powershell","tag-report","tag-sccm","tag-schema","tag-schema-version","tag-script","tag-version"],"aioseo_notices":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/posts\/1414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/comments?post=1414"}],"version-history":[{"count":13,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/posts\/1414\/revisions"}],"predecessor-version":[{"id":1432,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/posts\/1414\/revisions\/1432"}],"wp:attachment":[{"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/media?parent=1414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/categories?post=1414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/tags?post=1414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}