So you went ahead and installed SharePoint 2016 for the first time, but now when running the PSConfig wizard, you are presented with a new screen you’ve never seen or heard of before? Yeah, that is called the MinRole, and it’s a shiny new feature in SharePoint 2016. Actually, without a single doubt, it is the biggest noticeable change you will see in the SharePoint 2016 IT Preview compared to previous versions of SharePoint. MinRoles are based on configuration best practices that Microsoft has established over the years. It automatically enables and configure specific services on the SharePoint server based on the role it was assigned. The PSConfig wizard screen that is made available in the SharePoint 2016 IT Preview looks like the following:
Now, the first question that probably comes to mind when playing with those bits for the first time, is “What role should I choose”? Followed by “What if I pick the wrong one, can I change it after?” In order to help you determine what role to choose, Microsoft has developed a great TechNet article that goes in length about what each role does (https://msdn.microsoft.com/en-us/library/mt346114(v=office.16).aspx ), so I will let them answer the first question, but to answer the second question, yes you can change it after you selected one. The SharePoint 2016 Preview includes an administrative page in Central Administration to allow you to quickly change a role, but we’re not interested in that! Let’s look at how it can be achieved using PowerShell.
Before we get started I go into the details of how to change the MinRole assigned to a server in your farm, let’s take a step back for a minute and look at how MinRole are actually assigned. When using the PSConfig wizard to create a new farm, what we are really doing in the background (from a PowerShell perspective) is call the New-SPConfigurationDatabase cmdlet (and a whole bunch of other ones as well off course). It is this cmdlet that got updated in SharePoint 2016 to receive the MinRole parameter. This cmdlet now accepts a new parameter called –LocalServerRole which specifies the MinRole to assign to a server. However, if you are using the PSConfig wizard to join a server to an existing farm, the cmdlet being used is called Connect-SPConfigurationDatabase, and just like the other cmdlet, this one has been updated in SharePoint 2016 to also accept a new parameter called –LocalServerRole. The value for these roles is obtained from Microsoft.SharePoint.Administration.SPServerRole. Using PowerShell we can easily extract the available values from this list:
Now that we are done with the theory part, let’s get our hands dirty. In my scenario, I have created a new farm with a single server in it (for dev purposes off course J). When using the initial PSConfig wizard, I selected my server to run the Search MinRole. However, I now want to change it to use the Single Farm MinRole. What I need to do first is to disconnect my server from the farm’s Configuration Database. This can be achieved by calling the Disconnect-SPContentDatabase PowerShell cmdlet. Note that you may need to close an re-open the SharePoint Management Shell after running this operation.
Now that the server has been properly disconnected from the Configuration Database, we need to join it back to the farm calling the Connect-SPConfigurationDatabase PowerShell cmdlet, but this time passing the new value for its MinRole, in our case SingleServerFarm.
$PassPhrase = ConvertTo-SecureString “pass@word1” -AsPlainText -Force
Connect-SPConfigurationDatabase -DatabaseServer “.” -DatabaseName “SharePoint_Config” -PassPhrase $PassPhrase -LocalServerRole “SingleServerFarm”
Once the operation completes, your server will be joined to the farm, and be assigned the new specified MinRole!
*Note: You may have to re-run PSConfig after reconnecting to the Configuration Database for your changes to kick in.