Wednesday, October 19, 2016

Change SharePoint 2016 Server Role

Open "Sharepoint 2016 Management Shell" (Run as administrator)

Type "Get-SPServer" to get the current server list:

Example:


Server types:
WebFrontEnd
Application
DistributedCache
Search
Custom
Single-server farm*

For example we want to change SERVER1 role to "WebFrontEnd"
Set-SPServer -Identity SERVER1 -Role WebFrontEnd

If you get error:
Set-SPServer : SERVER1: The Distributed Cache service instance must be removed. Run 'Remove-SPDistributedCacheServiceInstance' on this server to remove the Distributed Cache service instance.
At line:1 char:1
+ Set-SPServer -Identity SERVER1 -Role WebFrontEnd
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Set-SPServer], PSArgumentException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletSetServer


Fix it by running "Remove-SPDistributedCacheServiceInstance" on that server and if everything goes well you can run "Set-SPServer -Identity SERVER1 -Role WebFrontEnd" once again.

After that you can check server role by running command "Get-SPServer" or visiting your farm site:
http://*spfarm*/_admin/FarmServers.aspx


References:

No comments:

Post a Comment