Error: “Unable to match the identifier name Win2016 to a valid enumerator name”

Building a Windows Server 2016 as a Domain Controller is pretty easy using Windows PowerShell. But when you try to deploy Active Directory by specifying Windows Server 2016 Functional level, you may get the following error:

Cannot convert value “Win2016” to type “Microsoft.DirectoryServices.Deployment.Types.DomainMode”.

Error: “Unable to match the identifier name Win2016 to a valid enumerator name. Specify one of the following enumerator names and try again: Win2008, Win2008R2, Win2012, Win2012R2, WinThreshold, Default”

Let’s start by running the following command to deploy your Active Directory:

PS C:\Users\Administrator> Install-ADDSForest `
 -CreateDnsDelegation:$false `
 -DatabasePath "C:\Windows\NTDS" `
 -DomainMode "Win2016" `
 -DomainName "get-cmd.Local" `
 -DomainNetbiosName "get-cmd" `
 -ForestMode "Win2016" `
 -InstallDns:$true `
 -LogPath "C:\Windows\NTDS" `
 -NoRebootOnCompletion:$false `
 -SysvolPath "C:\Windows\SYSVOL" `
 -Force:$true

PowerShell returns an error because “Win2016” is not a supported value. The DomainMode and ForestMode values does not exist. It seems that Microsoft does not add this enumerator name. If you check the documentation on this web site: https://technet.microsoft.com/en-us/library/hh974720(v=wps.630).aspx you will notice that the Win2016 value is missing.

powershell2016value

Fortunately, you can still use the integer value. So just use “7” instead of “Win2016” and you can deploy your Active Directory!

PS C:\Users\Administrator> Install-ADDSForest `
 -CreateDnsDelegation:$false `
 -DatabasePath "C:\Windows\NTDS" `
 -DomainMode "7" `
 -DomainName "get-cmd.Local" `
 -DomainNetbiosName "get-cmd" `
 -ForestMode "7" `
 -InstallDns:$true `
 -LogPath "C:\Windows\NTDS" `
 -NoRebootOnCompletion:$false `
 -SysvolPath "C:\Windows\SYSVOL" `
 -Force:$true

 

Thanks for reading! You can follow me on Twitter @PrigentNico

About Nicolas 282 Articles
I work as an IT Production Manager, based in Paris (France) with a primary focus on Microsoft technologies. I have 10 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSE: Cloud Platform and Infrastructure", "MCSA: Windows Servers", "Administering & Deploying SCCM", and CheckPoint CCSA certified.