Determine MinRole Compliance via PowerShell

MinRole compliance is available via Central Administration, but what if you needed to determine MinRole compliance via PowerShell? There’s no simple property via  Get-SPServer or any other similar PowerShell methods. Instead, we must use reflection. Reflection is generally unsupported by Microsoft, so do keep that in mind. This script is simple, use the SharePoint Management Shell (so we don’t have to manually load the assembly) and just make sure to pass the server name into the first line.

It will output a true or false statement. If the value returns true, the server is in compliance with the assigned MinRole, and conversely, if the value is false, the server is not in compliance with the assigned MinRole.

If the server is using the Custom role, there will be no output. Instead, ULS will log this message.

And that’s it. Hopefully in the future Microsoft will provide an out of the box, fully supported method to get this particular detail.

Leave a Reply