How to Speed Up the Installation of SharePoint Cumulative Updates using PowerShell Step by Step
Tags: sharepoint2019, sharepoint2016, sharepoint2013, sharepoint
Published: 2019-05-15 21:55:47

---
title: How to Speed Up the Installation of SharePoint Cumulative Updates using PowerShell Step by Step
published: true
tags: SharePoint 2019,SharePoint 2016,SharePoint 2013,SharePoint
canonical_url: https://blogit.create.pt/miguelisidoro/2019/05/02/how-to-speed-up-the-installation-of-sharepoint-cumulative-updates-using-powershell-step-by-step/
---

The post [How to Speed Up the Installation of SharePoint Cumulative Updates using PowerShell Step by Step](https://blogit.create.pt/miguelisidoro/2019/05/02/how-to-speed-up-the-installation-of-sharepoint-cumulative-updates-using-powershell-step-by-step/) appeared first on [Blog IT](https://blogit.create.pt).

This post will explain how you can speed up the installation of Cumulative Updates in a SharePoint farm step by step using PowerShell. Using PowerShell, you can greatly reduce the time it takes to update your SharePoint farm which can take several hours to complete if you use the traditional method of installing Cumulative Updates. The steps described in this post are valid for SharePoint 2013, SharePoint 2016 and SharePoint 2019.

This post assumes a single SharePoint server but if you have multiple SharePoint servers, you must follow these steps on all SharePoint servers in your farm.

## Introduction

The SharePoint world is rapidly moving into the Cloud with SharePoint Online and Office 365, but some organizations are still not ready to move completely to Office 365 and SharePoint Online.

Upgrading to SharePoint 2019 that has support for a hybrid scenario can be a valid solution to allow a gradual move to the cloud.

Installing a SharePoint 2019 farm can be done in an automated way using PowerShell and [AutoSPInstaller.](https://autospinstaller.com/) One additional advantage of this installation process ensures that the SharePoint farm is installed with the latest updates, leaving the SharePoint farm updated and working properly (if you want to learn how to install a SharePoint 2019 farm in an automated way, click [here](https://dev.to/mlisidoro/how-to-install-a-sharepoint-2019-farm-using-powershell-and-autospinstaller-part-1-5bjp) and [here](https://dev.to/mlisidoro/how-to-install-a-sharepoint-2019-farm-using-powershell-and-autospinstaller-part-2-1b9k)[)](https://dev.to/mlisidoro/how-to-install-a-sharepoint-2016-farm-using-powershell-and-autospinstaller-part-2-5e36).

To ensure that after the installation, the SharePoint server is kept always updated, we must ensure that both the Windows Updates and specially the SharePoint Cumulative Updates are properly installed.

## Installing SharePoint Updates

To install the latest SharePoint Cumulative Updates in your farm, follow the following steps:

- Download the SharePoint Cumulative Updates 
- Backup SharePoint Farm and Configurations
- Install the Cumulative Updates in the SharePoint Farm (using PowerShell)
- Run SharePoint Products and Configuration Wizard

### Download the SharePoint Cumulative Updates 

All starts by downloading the latest SharePoint Cumulative Updates. To do that, you must download:

- SharePoint 2016 and SharePoint 2019:
  - The latest language independent SharePoint updates
  - The latest language dependent SharePoint updates (if you have any language pack installed in your farm)
- SharePoint 2013:
  - The latest SharePoint Server updates
  - The latest SharePoint foundation updates

To stay up to date and download with the latest updates, click [here](https://buildnumbers.wordpress.com/sharepoint/).

### Backup SharePoint Farm and Configurations

Before applying the updates, you should perform the following backups:

- Backup the SharePoint farm by running the following command:    
**_Backup-SPFarm -Directory <BackupFolder> -BackupMethod Full -Verbose_**

The backup folder should be a shared folder on the network, accessible by both SharePoint and database servers.

Ensure the SharePoint Server 2013 VSS Writer service is started on the SharePoint server (not started automatically).

Ensure the SQL Server VSS Writer service is started on the database server.

For more details about SharePoint farm backup, click [here](https://docs.microsoft.com/en-us/SharePoint/administration/prepare-to-back-up-and-restore), [here](https://docs.microsoft.com/en-us/sharepoint/administration/back-up-a-farm)and [here](https://docs.microsoft.com/en-us/sharepoint/administration/best-practices-for-backup-and-restore)

- Backup all SharePoint databases in the database server that supports the SharePoint farm using SQL Server Enterprise tools
- Backup the web.config files for all web applications
- If you have custom developed solutions using server-side code, backup the solutions. To make this easier, you can download a [PowerShell script](https://github.com/miguelisidoro/SharePoint/blob/master/PowerShell/SharePoint2019/Export-WSP.ps1) from my GitHub repository  

### Install the Cumulative Updates in the SharePoint Farm (using PowerShell) 

After downloading the latest updates and taking the necessary precautions, you are ready to install them in your SharePoint farm.

If you want to use the traditional method to update your farm, click [here](https://dev.to/mlisidoro/how-to-install-sharepoint-cumulative-updates-in-a-sharepoint-farm-step-by-step-f50). If you want to learn the PowerShell way and speed up the installation of the Cumulative Updates in your SharePoint farm, read on!

To download the SharePoint Patch PowerShell script, click [here](https://github.com/Nauplius/SharePoint-Patch-Script/). This script is an improved version of a [PowerShell script](https://blog.russmax.com/why-sharepoint-2013-cumulative-update-takes-5-hours-to-install/) originally created by Russ Maxwell for SharePoint 2013.

The way this PowerShell script ensures that the SharePoint patch process time is reduced from 4 to 5 hours to less than one hour is by doing the following:

- If you choose to (use the -Pause switch parameter), suspends the Search Service Application. This is very important since if a search crawl was triggered during the installation of the Cumulative Update, the Search Application could get corrupted and you could be forced to rebuild the entire Search Service Application, recreate any custom managed properties and perform a Full Crawl again to ensure you have search results and all search based solutions work properly
- For SharePoint 2013 (not necessary for SharePoint 2016 and SharePoint 2019), the following services will be disabled and then stopped:
  - Search services are disabled
  - Search services are stopped
  - IISAdmin and SPTimerV4 services are disabled
  - IISAdmin and SPTimerV4 services are stopped
- If you choose to, the Cumulative Updates are installed are in passive mode (without any necessary user interaction) but you can still see the installation process in the UI
- When the installation of the Cumulative Updates is complete:
  - For SharePoint 2013 (not necessary for SharePoint 2016 and SharePoint 2019), the following services will be set to automatic:
    - Search services
    - IISAdmin and SPTimerV4 services
  - If you choose to use the -Pause switch parameter, the Search Service Application will be resumed

To start the installation process, open the SharePoint PowerShell window and execute the following commands:

- Import-Module .\SharePointPatchScript.psm1
- Install-SPPatch -Path <PatchFolder> -Pause
  - Example: Install-SPPatch -Path D:\SharePoint\Updates -Pause

This will start the SharePoint farm update process (examples for SharePoint 2013 and SharePoint 2019).

For SharePoint 2013, both SharePoint Server and SharePoint Foundation packages will be detected automatically and installed.

![](https://i1.wp.com/blogit.create.pt/wp-content/uploads/2019/05/SP2013_ApplyUpdate.png?resize=680%2C544&ssl=1)<figcaption><em>SharePoint 2013 farm update using PowerShell</em><br></figcaption>

For SharePoint 2016 and SharePoint 2019, both language independent and language dependent packages will be detected automatically and installed.

![](https://i2.wp.com/blogit.create.pt/wp-content/uploads/2019/05/SP2019_ApplyUpdate.png?w=696&ssl=1)

![](https://i2.wp.com/blogit.create.pt/wp-content/uploads/2019/04/SP2019_Install_Update_Progress.png?w=696&ssl=1)<figcaption> <em>SharePoint 2019 farm update using PowerShell</em><br></figcaption>

Instead of taking hours to perform, the updates should be installed in less than one hour.

![](https://i0.wp.com/blogit.create.pt/wp-content/uploads/2019/05/SP2019_ApplyUpdate_Finish.png?w=696&ssl=1)<figcaption> <em>SharePoint 2019 farm update using PowerShell</em> (installation complete)</figcaption>

A reboot to the server may be necessary.

![](https://i1.wp.com/blogit.create.pt/wp-content/uploads/2019/04/SP2019_Install_Update_Reboot.png?w=696&ssl=1)<figcaption>Reboot to the server after Installation of the Cumulative Updates</figcaption>

To read the entire article and learn more on how to update your SharePoint farm, click [here](https://blogit.create.pt/miguelisidoro/2019/05/02/how-to-speed-up-the-installation-of-sharepoint-cumulative-updates-using-powershell-step-by-step/).

Happy SharePointing!

The post [How to Speed Up the Installation of SharePoint Cumulative Updates using PowerShell Step by Step](https://blogit.create.pt/miguelisidoro/2019/05/02/how-to-speed-up-the-installation-of-sharepoint-cumulative-updates-using-powershell-step-by-step/) appeared first on [Blog IT](https://blogit.create.pt).