This week I had a boring demand of checking up a Sitecore installation against the Excel spreadsheet provided by Sitecore, to make sure all configs are enabled or disabled according to the Server Role.
You can get cockeyed by doing this manually, so of course I looked for a way to automatize it. Ended up discovering this simple powershell script written by Michael West. The only issue with this script is it does touches the files while checking, something I’d never dare doing in production.
I have modified his script so that, instead of touching the files, it takes notes of files that are different than specified by Sitecore’s spreadsheet so one can compare it manually afterwards. Resulting script can be seen at this link.
But what if you wish to have the same Sitecore installation handling multiple roles? According to Martina Welander, the general recommendation for mixed roles is that, if something must be enabled anywhere, that config must be enabled. Well, while this is not a rule we can trust 100%, still the script is not changing anything and thus it won’t hurt if it does this check.
You can check for multiple roles by adding them separated by commas (Eg: CM, RPT)