Monthly Archive

Categories

Monthly Archives: December 2016

Christmas treat

If you’re looking for something to treat yourself for Christmas then garb a copy of My new book – Learn Hyper-V in a Month of Lunches.

 

Better still tomorrow 18 December 2016 you can get the book for half price:

 

Deal of the Day December 18: Half off Learn Hyper-V in a Month of Lunches. Use code dotd121816au at http://bit.ly/2hOkhKb

Active Directory Schema Versions

With the release of Windows Server 2016 its time to update my schema versions script

 

$sch = [System.DirectoryServices.ActiveDirectory.ActiveDirectorySchema]::GetCurrentSchema()
$de = $sch.GetDirectoryEntry()
switch ($de.ObjectVersion) {
13{"{0,25} " -f "Schema Version $($de.ObjectVersion) = Windows 2000"; break}
30{"{0,25} " -f "Schema Version $($de.ObjectVersion) = Windows 2003"; break}
31{"{0,25} " -f "Schema Version $($de.ObjectVersion) = Windows 2003 R2"; break}
44{"{0,25} " -f "Schema Version $($de.ObjectVersion) = Windows 2008"; break}
47{"{0,25} " -f "Schema Version $($de.ObjectVersion) = Windows 2008 R2"; break}
56{"{0,25} " -f "Schema Version $($de.ObjectVersion) = Windows 2012"; break}
69{"{0,25} " -f "Schema Version $($de.ObjectVersion) = Windows 2012 R2"; break}
87{"{0,25} " -f "Schema Version $($de.ObjectVersion) = Windows 2016"; break}
default{"{0,25} {1,2} " -f "Unknown Schema Version", $($de.ObjectVersion); break}
}

 

The script uses the GetCurrentSchema static method on System.DirectoryServices.ActiveDirectory.ActiveDirectorySchema. Derives a directory entry and uses the ObjectVersion to determine the corresponding Windows Server version.