Recently needed to do an update of eight farms for a client. Now I can never do as thorough of a job as Microsoft and others have done describing the process so I will not even attempt it. (see also links at bottom).
What I needed was a way to walk through the whole phase as simply as possible so I wrote and/or borrowed code for a PowerShell script to streamline the process
Basic steps of the script
- Copy updates to all servers in farm
- Prompt user to remove a web front end (WFE) user from Network Load Balancer(NLB)
- Enable Side By Side SharePoint code on that WFE
- Trigger the coping of Side By Side files to the c:\program files\common files\microsoft shared\web server extensions\16\template\layouts\{current SharePoint version number}
- Prompt user to install patch on this WFE (may possibly automate this) and reboot server
- Prompt user to add WFE back into NLB and remove other WFE (could add a loop for more than 2 WFE)
- Enable Side by Side on second WFE
- Trigger SharePoint file copy
- Prompt to install patches on second WFE and reboot server
- Disables the Distributed Cache(DC) on the first server designated with the "DistributedCache" role
- Prompts user to install patched on this server and reboot.
- Re-enables the distributed cache on this server
- Disables the DC on the second server
- Prompts to install patches and reboot server
- Re-enables the distributed cache on this server
- Runs database upgrade on all content databases
- Runs PSConfig on each server one at a time maintaining availability of all services
- Set Side By Side to the new version that has just been installed on all servers
Command Line
PS> .\SP-UpdateFarm.ps1
-farmaccount "test\test-farm" -weburl "https://test-partner.example.com/"
-wfeSvr01 "TESTWFE01" -wfeSvr02 "TESTWFE01"
-otherSvrs01 @( "TESTAPP01", "TESTSRCH01",
"TESTDCS01") -otherSvrs02 @( "TESTAPP02",
"TESTSRCH02", "TESTDCS02") -test $true
Parameters
[string] $farmaccount ="The Farm account to connect to SharePoint"[string] $weburl ="Web application URL to the use for upgrading"
[string] $wfeSvr01 = "Name of the first Web Front End"
[string] $wfeSvr02 ="Name of the Second Web Front End"
Array $otherSvrs01="Other servers in your HA farm all 01"
Array $otherSvrs02 ="Other servers in your HA farm all 02"
[string] $patchFolderUNC ="UNC to copy the upgrade files from"
[string] $patchInstallFolder="The folder to place the upgrade files in on remote servers"
[bool]$test ="run through script connecting to servers but not actually performing actions"
Gotchas
- if you have a folder in the "web server extensions\16\template\layouts" folder that looks like a version number for example 1.2.3.4 it can be deleted when you enable the Side By Side
- remote powershell must be allowed for this to work
- you must run as Farm account
- PowerShell must be run as Administrator
SP-UpgradeFarmZDP.ps1
See also:
https://technet.microsoft.com/en-us/library/mt767550(v=office.16).aspx
https://technet.microsoft.com/en-us/library/mt743024(v=office.16).aspx
https://blogs.technet.microsoft.com/pla/2016/03/10/zero-downtime-patching-in-sharepoint-server-2016/
https://technet.microsoft.com/en-us/library/cc748824(v=office.16).aspx