PS0159: The operation is not supported at the current Farm Behavior Level ‘1’. Raise the farm to at least version ‘2’ before retrying.

By | 19th February 2019

When running AD FS on a Windows Server 2016 you might get the error message:
PS0159: The operation is not supported at the current Farm Behavior Level ‘1’. Raise the farm to at least version ‘2’ before retrying, when you try to enable some new services such as the ESL (Extranet Smart Lockout).

This can happen if you have upgraded your AD FS farm from Windows Server 2012 R2 to Windows 2016 and you have not raised the Farm behavior level during the upgrade. Read my post for a step-by-step process on upgrading your AD FS 3.0 environment to AD FS 4.0

To fix this specific error follow these steps:

First you can check the current farm behavior level by running the cmdlet:

Get-AdfsFarmInformation
In the above screenshot you can see that the current FarmBehavior level is 1.

Raise the behavior level

To raise the farm behavior level in an environment with a WID database run the cmdlet, if your environment uses a SQL database you have to specify the credential of the service account.

You do not have specify the new level, actually you can’t specify the new level, the command applies the latest version available on your forest.

Use the cmdlet below if your farm uses a SQL server database:

After the command has completed verify if the new farm Behavior level by running the cmdlet:

Notice that the CurrentFarmBehavior level is now 3

Get-AdfsFarmInformation



I hope this was informative. For questions or comments you can always give a reaction in the comment section or contact me:

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.