Keep your own MachineKey values in SharePoint 2010 web.config

 

In some cases you may need to have specific MachineKey values in the SharePoint web applications web.config. SharePoint will accept this change briefly but will will soon change it to a different value midnight.

 

This timer job: Health Analysis Job (Daily, Microsoft SharePoint Foundation Web Application, All Servers) will override any modifications to the <machinekey>   values in the web.config of web applications.

The timer job runs daily at mid night and will execute a number of health rule checks (for full list of health rule checks in the farm run Get-SPHealthAnalysisRule).

One particular health rule is responsible for ensuring that <machinekey> values are kept in synch across all web applications, the health rule name is ViewStateKeysAreOutOfSync.

The issue with this health rule is that it will revert the values of the <machinekey> to some values stored in the config db which stops us from using our custom machine key values.

The solution is to disable the  ViewStateKeysAreOutOfSync health analysis rule by running the following PowerShell cmdlet:

Get-SPHealthAnalysisRule ViewStateKeysAreOutOfSync | Disable-SPHealthAnalysisRule

 

 

Also check this article for background information on the issue: https://blogs.msdn.com/b/allenwang/archive/2012/03/23/sharepoint-2010-health-analyser-timer-job-changed-custom-web-config-machine-key.aspx 

 

 

cheers,
- mutaz