-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
SPSUpdate.ps1 installs SharePoint cumulative updates, mounts/upgrades content databases
in parallel and runs the post-setup Configuration Wizard (PSConfig) across the farm. Shared
logic lives in the SPSUpdate.Common module; the script just orchestrates it.
- PowerShell 5.1 or later.
- Administrator rights and access to the SharePoint farm.
- The package extracted on each SharePoint server (
SPSUpdate.ps1,Config\,Modules\). - Cumulative update files copied on each server (for
ProductUpdate).
| Parameter | Description |
|---|---|
ConfigFile |
Path to the environment configuration file (*.psd1). Required.
|
Action |
(Optional) Install, Uninstall, Default, ProductUpdate or InitContentDB. Install/Uninstall manage the scheduled tasks and the stored secret (Install requires InstallAccount). ProductUpdate installs the binaries locally. InitContentDB (re)generates the ContentDatabase inventory JSON. Defaults to Default. |
Sequence |
(Optional, 1–4) Internal: selects which content-database group a parallel scheduled task processes. |
InstallAccount |
(Optional) Required with -Action Install. The service account stored in secrets.psd1. |
.\SPSUpdate.ps1 -ConfigFile 'CONTOSO-PROD-CONTENT.psd1'.\SPSUpdate.ps1 -ConfigFile 'CONTOSO-PROD-CONTENT.psd1' -Sequence 1.\SPSUpdate.ps1 -ConfigFile 'CONTOSO-PROD-CONTENT.psd1' -Action Install -InstallAccount (Get-Credential).\SPSUpdate.ps1 -ConfigFile 'CONTOSO-PROD-CONTENT.psd1' -Action Uninstall.\SPSUpdate.ps1 -ConfigFile 'CONTOSO-PROD-CONTENT.psd1' -Action ProductUpdate.\SPSUpdate.ps1 -ConfigFile 'CONTOSO-PROD-CONTENT.psd1' -Action InitContentDBThis (re)generates the ContentDatabase inventory JSON file
(<ApplicationName>-<ConfigurationName>-<FarmName>-ContentDBs.json) for the local farm. It
is typically used on the source farm before a farm upgrade (for example SharePoint Server
2019 → Subscription Edition) so the inventory can be copied to the target farm and consumed
by the MountContentDatabase flow.
It also writes a self-contained HTML report of the inventory under Results\ (see below).
Whenever the inventory JSON is (re)generated — by -Action InitContentDB, or by the
Default master run when it first primes the inventory — SPSUpdate also writes a
self-contained HTML report next to the Logs\ and Config\ folders:
Results\<ApplicationName>-<ConfigurationName>-<FarmName>-ContentDBs.html
The report is dependency-free (no internet required) and shows:
- summary cards: total content databases, total size (MB), and the balance spread across the four sequences;
- the per-sequence distribution (count / size / percentage) reflecting the Longest-Processing-Time-First balancing;
- a sortable, filterable table of every database with its sequence, server, web application and size.
Inventories generated before v4.1.0 have no size information; the report still renders and falls back to distributing by database count. You can also generate the report on demand from an existing inventory with the public function:
Import-Module .\Modules\SPSUpdate.Common\SPSUpdate.Common.psd1
Export-SPSUpdateDbReport -InputFile '.\Config\contoso-PROD-CONTENT-ContentDBs.json' `
-OutputFile '.\Results\contoso-PROD-CONTENT-ContentDBs.html' `
-EnvName 'PROD' -AppCode 'contoso' -FarmName 'CONTENT'- Reads the
InstallAccountcredential fromsecrets.psd1(DPAPI). - If
UpgradeContentDatabaseorMountContentDatabaseis on, registers and starts fourSPSUpdate-Sequence1..4scheduled tasks that process the content-database groups in parallel (the groups are balanced by size using a Longest-Processing-Time heuristic), then waits for all four to finish. - Runs PSConfig on the local (master) server when a patch action is required, then on each remote server over CredSSP.
- Configures the side-by-side token and copies side-by-side files (when enabled).
Each run starts a transcript under Logs\ (the file name encodes the application,
environment and — when relevant — the sequence or action). The ContentDatabase inventory
HTML report is written under Results\. Lifecycle and error events are also written to the
dedicated SPSUpdate Windows Event Log via Add-SPSUpdateEvent.
- Ensure the account running the script has administrator rights and access to the farm.
- A missing secret raises a clear error pointing you to
-Action Install.
- Test the script in a non-production environment before deploying it widely.
When a status store is configured, SPSUpdate records the progress of every phase (ProductUpdate per server, the four mount/upgrade sequences, the Configuration Wizard per server, and side-by-side) into a shared location, and the master assembles a live HTML dashboard you can open in a browser while patching runs.
Set StatusStorePath in the environment config to a UNC share writable by the
InstallAccount from every farm server:
StatusStorePath = '\\fileserver\spsupdate-status'If left empty, SPSUpdate falls back to a local Results\status folder. In that case the
master still shows the mount/upgrade/wizard phases, but ProductUpdate runs launched on the
other servers are not captured centrally (they would each write to their own local folder).
The status files of one patching campaign live under
<StatusStorePath>\<App>-<Env>-<Farm>\, and the dashboard is written there as
_dashboard.html.
Important
The InstallAccount (the scheduled-task service account) must have Modify rights on
the share — both the SMB share permission and the NTFS permission. The four
upgrade/mount sequence tasks run as that account, so if it cannot write to the store the
sequences silently fail to publish their status and the Content database upgrade phase
never appears on the dashboard (only the ProductUpdate and Wizard sections, written by
the interactive/master run, show up). The ProductUpdate and Default runs you launch
interactively write under your own account, which can mask the problem during testing.
Test-SPSUpdateReadiness.ps1 probes write access both as the current user and as the
InstallAccount to catch this up front.
-
Reset the campaign once (clears any previous run):
.\SPSUpdate.ps1 -ConfigFile 'CONTOSO-PROD-CONTENT.psd1' -Action ResetStatus
-
Open
\<StatusStorePath>\<App>-<Env>-<Farm>\_dashboard.htmlin a browser. It auto-refreshes every 15 seconds while the campaign is in progress. -
Install the binaries on each server (each writes its ProductUpdate progress to the share):
.\SPSUpdate.ps1 -ConfigFile 'CONTOSO-PROD-CONTENT.psd1' -Action ProductUpdate
-
Run the master upgrade on the master server. It regenerates the dashboard as the four sequences, the Configuration Wizard and the side-by-side step progress, and turns the auto-refresh off with a final state when finished:
.\SPSUpdate.ps1 -ConfigFile 'CONTOSO-PROD-CONTENT.psd1'
The dashboard shows the overall state, per-server / per-sequence progress, per-database and per-binary item states with exit codes, and a completion percentage for each sequence.
Test-SPSUpdateReadiness.ps1 validates the environment before a run (read-only). It checks
the module import, the config keys, the DPAPI secret, elevation, the status store
reachability and write access, and the per-server WinRM/CredSSP reachability:
.\Test-SPSUpdateReadiness.ps1 -ConfigFile 'Config\CONTOSO-PROD-CONTENT.psd1'It exits non-zero when any check fails, so it can gate an automated rollout.
For issues or questions, open an issue or refer to the project documentation.
Navigation
Project