SharePoint 2016: Change Server Mini Roles using PowerShell
Introduction
Mini Role is a new feature introduced in SharePoint Server 2016 that optimizes the functioning of the servers in a SharePoint farm based on the role they have been assigned. So when you are configuring the server, depending on the intended functionality you may chose the appropriate mini role as shown below :
Mini Role |
Functionality |
Custom |
Custom service applications, services, and components that do not integrate with Mini Role, belong on Custom servers. The farm administrator has full control over which service instances can run on servers assigned to the custom Role. |
Web Front End |
Services end user requests, optimized for low latency. |
Single Server Farm |
Provisions all services on the server for a single server deployment. This role is provided for evaluation and development purposes. |
Search |
Reserved for Search services. |
Application |
Services the backend jobs or the requests triggered by backend jobs, optimized for high throughput. |
Distributed Cache |
Services distributed cache for the farm. Optionally, the server assigned to this role can load balance end user requests among the web front ends. |
Table Source: Microsoft MSDN
What are we going to do
When you are configuring the farm using SharePoint Products Configuration wizard, we will get a window where we can specify the server role as shown below. Depending on the requirement we can select one of the roles for the current server. If we are configuring a search server we should select ‘Search’ Mini Role else if we are looking to configure SSRS Reporting Services we should be selecting ‘Custom’ Mini Role and so on.
However there can be instances where we create a server using one mini role and we would like to change the role to a different one say: we created the server using ‘Front-end’ role and at a later point we are deciding to change it to ‘Search’ role. In this article we will see how we can do that using PowerShell.
Change Server Mini Role using PowerShell
In order to do that spin up SharePoint 2016 Management Shell as administrator.
Run the command ‘Get-SPServer’ to get the servers and their current roles in the farm.
Running the below command will list out all the mini roles that are available for assignment.
[System.Enum]::GetNames([Microsoft.SharePoint.Administration.SPServerRole])
Now, let’s try to assign a new mini role to the server by running the below command. This will assign the server, the mini role – ‘WebFrontEnd’.
Set-SPServer -Identity "SP2016S2" -Role "WebFrontEnd"
The role conversion process is performed by a timer job. We can get the status of the timer job by running the below command. On successful completion of the time job we will not be getting any specific return messages. It will complete the command execution and go to the next line as shown below; else we will get a message stating that the timer job has not run.
Get-SPTimerJob “Timer Job ID”
We can also verify the timer job from ‘Central Administration -> Review Job Definitions’.
Here we can spot the ‘Server Role Conversion Job’ timer job and check its status.
Once it has run to completion we can head over to the ‘Servers in Farm‘ page. Here we can see that the server has been assigned a new Mini Role.
Mini Role Changes After Feature Pack 1 Installation
Feature Pack is an innovative step taken by Microsoft to add new features to SharePoint Product line which were not really announced as part of the initial product release. Earlier, a new feature made its way to SharePoint only as part of Product Launch which happened in three-year intervals. SharePoint Team will now be taking feedback, and new features will be deployed as feature packs to SharePoint Server at regular intervals. This will keep SharePoint Server updated with new Cloud features introduced in SharePoint Online.
Feature Pack 1 aka November 2016 CU for SharePoint Server 2016 has been made publicly available on November 8. The build number for this release is 16.0.4456.1002. You can download the Feature Pack 1 from here. Once you download and install Feature Pack 1 you will get additional 2 Shared Mini Roles which can be utilized for configuring the SharePoint Farm. The newly added Shared Mini Roles are:
- Front-end with Distributed Cache
- Application with Search
This way, a server can share 2 Mini Roles, thereby reducing the number of servers required for the farm.
Assign new Feature Pack 1 Server Roles using PowerShell
Run the command ‘Get-SPServer’ to get the servers and their current roles in the farm.
Running the below command will list out all the Mini Roles that are available for assignment.
[System.Enum]::GetNames([Microsoft.SharePoint.Administration.SPServerRole])
Prior to installing Feature Pack1, running the above command yielded the below results:
However post installation of Feature Pack1; we can see the new Shared Mini Roles as well.
Now, let’s assign the Shared Mini Role,”ApplicationWithSearch” to the server by running the below command.
Set-SPServer -Identity "VM04-MiniRole" -Role " ApplicationWithSearch"
The job conversion is performed by a timer job; you can get its run status by running the Get-SPTimerJob command:
Thus the timer job has run and the role conversion has been completed. You can check the status by running the Get-SPServer command once again.
As you can see the Search Role has been converted to “ApplicationWithSearch” Mini Role.
Summary
Thus we saw in in depth how to change the Server Roles using PowerShell in SharePoint Server 2016
See Also
More details can be viewed from the below article :