Raising the functional level to Windows 2012 or Windows 2012 R2... Will I break anything?

2/26/2016 Update, cf the I disagree with the PowerShell output section.

In short, yes... Meaning that it is possible that you are facing the same problem as the one described here: FIX: "The requested mode is invalid" error message when you run a managed application that uses the .NET Framework 3.5 SP1 or an earlier version to access a Windows Server 2008 R2 domain or forest but for 2012/2012 R2.

What is happening?

The DLL System.directoryservices.dll has a class called System.DirectoryServices.ActiveDirectory.Domain which has a property called DomainMode which tells you what is the functional level associated to the domain you are instantiating. So if you use a version of the Framework which has been release before Windows 2012/2012R2 has been release, you will face the same problem as you faced in the KB mentioned at the beginning of the article. Simple way to check is to use the "Other version" link of the MSDN article:

Unfortunately, it is not up to date. It tells you only the list of supported DomainMode at the time of the realase of the the selected Framework version. You can still use this good old PowerShell to list what your current system supports:

[System.DirectoryServices.ActiveDirectory.DomainMode] | Get-Member -Static -MemberType Properties | Format-Table Name

Here is the output on my machine:

Name
----
Windows2000MixedDomain
Windows2000NativeDomain
Windows2003Domain
Windows2003InterimDomain
Windows2008Domain
Windows2008R2Domain
Windows2012R2Domain
Windows8Domain

I disagree with the PowerShell output

Well even if you have installed the latest .Net Framework, you might see that the PowerShell output doesn't show all the new fancy functional levels. And it has to do with the fact that PowerShell might not use the latest runtime... Try this:

[Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()

It will tell you whether or not you are using the latest runtime. If you don't see the expected value in the PowerShell output, make sure it's not a side effect of using the old runtime... How to change that behavior and makes PowerShell use the latest runtime? You can look at the powershell.exe.config file and modify it accordingly... I don't find official guidance around it, so I'll let you bing the world :)

What are the odds?

In order to face this problem, planets needs to be in a perfect alignment.

- Obviously, you need to have only Windows Server 2012/2012 R2 domain controllers.
- You need also a version of the .Net Framework which is not up to date.
- You need to actually use the class and property mentioned above. It means that even if you use an old version of the Framework, you are affected only if you use this class.

What do I do?

Nothing. Because your release management is impeccable, your Framework is probably already up to date. What if it is not the case? Well, you can update it then. Or ask for an updated version of the application using this class. Or if you are your own developer, manage the exception when using the class with some Try Catch logic.

A bit more info about the KB2260240: Raising the functional level - Are you getting cold feet because of KB2260240?

What are the odds?