Advanced Windows PowerShell Scripting Video Training

Advanced Windows PowerShell Scripting Video Training
Advanced Windows PowerShell Scripting Video Training

Tuesday, May 24, 2011

Set forest and domain modes with PowerShell

Both the domain and forest functional modes in a Windows domain will determine what functionality that you get.  When you purchase a new Windows Server OS, it comes with more advanced functionality than the previous version.  Some of that functionality may not be compatible with previous versions of the server OS.  In order to raise the functional level to say, Windows Server 2008, you need to upgrade all your domain controllers to a minimum of Windows Server 2008.  You can still have Windows 2000 and 2003 member servers, just not as domain controllers.

You can use PowerShell to raise both your functional levels.  Here is an example of how to raise both levels to Windows Server 2008 R2.

Open PowerShell
Import-Module ActiveDirectory
Set-ADDomainMode –Identity (Get-ADDomain) –DomainMode Windows2008R2Domain
Set-ADForestMode –Identity (Get-ADDomain) –DomainMode Windows2008R2Forest

The valid values are:

ID Domain Forest
0 Windows2000Domain Windows2000Forest
1 Windows2003InterimDomain Windows2003InterimForest
2 Windows2003Domain WIndows2003Forest
3 Windows2008Domain Windows2008Forest
4 WIndows2008R2Domain Windows2008R2Forest

No comments: