Skip to content

SPProductUpdate

Yorick Kuijs edited this page Jul 10, 2020 · 20 revisions

SPProductUpdate

Parameters

Parameter Attribute DataType Description Allowed Values
SetupFile Key String The name of the update setup file
ShutdownServices Write Boolean Shutdown SharePoint services to speed up installation
BinaryInstallDays Write StringArray[] Specify on which dates the installation is allowed mon, tue, wed, thu, fri, sat, sun
BinaryInstallTime Write String Specify in which time frame the installation is allowed
Ensure Write String Present to install SharePoint. Absent is currently not supported Present, Absent
InstallAccount Write PSCredential POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5

Description

Type: Common Requires CredSSP: No

This resource is used to perform the update step of installing SharePoint updates, like Cumulative Updates and Service Packs. The SetupFile parameter should point to the update file. The ShutdownServices parameter is used to indicate if some services (Timer, Search and IIS services) have to be stopped before installation of the update. This will speed up the installation. The BinaryInstallDays and BinaryInstallTime parameters specify a window in which the update can be installed. This module requires the Configuration Wizard resource to fully complete the installation of the update, which can be done through the use of SPConfigWizard.

NOTE: When files are downloaded from the Internet, a Zone.Identifier alternate data stream is added to indicate that the file is potentially from an unsafe source. To use these files, make sure you first unblock them using Unblock-File. SPProductUpdate will throw an error when it detects the file is blocked.

IMPORTANT: Since v3.3, this resource no longer relies on the farm being present to check the installed patches. This means it is now possible to deploy updates during the installation of SharePoint:

  1. Install the SharePoint Binaries (SPInstall)
  2. (Optional) Install SharePoint Language Pack(s) Binaries (SPInstallLanguagePack)
  3. Install Cumulative Updates (SPProductUpdate)
  4. Create SPFarm (SPFarm)

Examples

Example 1

This example installs the Cumulative Update only in the specified window. It also shuts down services to speed up the installation process.

    Configuration Example
    {
        param(
            [Parameter(Mandatory = $true)]
            [PSCredential]
            $SetupAccount
        )
        Import-DscResource -ModuleName SharePointDsc

        node localhost {
            SPProductUpdate InstallCUMay2016
            {
                SetupFile            = "C:\Install\CUMay2016\ubersrv2013-kb3115029-fullfile-x64-glb.exe"
                ShutdownServices     = $true
                BinaryInstallDays    = "sat", "sun"
                BinaryInstallTime    = "12:00am to 2:00am"
                Ensure               = "Present"
                PsDscRunAsCredential = $SetupAccount
            }
        }
    }

Example 2

This example installs the SharePoint 2013 Service Pack only in the specified window. It also shuts down services to speed up the installation process.

    Configuration Example
    {
        param(
            [Parameter(Mandatory = $true)]
            [PSCredential]
            $SetupAccount
        )
        Import-DscResource -ModuleName SharePointDsc

        node localhost {
            SPProductUpdate InstallCUMay2016
            {
                SetupFile            = "C:\Install\SP2013SP1\officeserversp2013-kb2880552-fullfile-x64-en-us.exe"
                ShutdownServices     = $true
                BinaryInstallDays    = "sat", "sun"
                BinaryInstallTime    = "12:00am to 2:00am"
                Ensure               = "Present"
                PsDscRunAsCredential = $SetupAccount
            }
        }
    }

Example 3

This example installs the SharePoint 2013 Dutch Language Pack Service Pack only in the specified window. It also shuts down services to speed up the installation process.

    Configuration Example
    {
        param(
            [Parameter(Mandatory = $true)]
            [PSCredential]
            $SetupAccount
        )
        Import-DscResource -ModuleName SharePointDsc

        node localhost {
            SPProductUpdate InstallCUMay2016
            {
                SetupFile            = "C:\Install\SP2013-LP_NL-SP1\serverlpksp2013-kb2880554-fullfile-x64-nl-nl.exe"
                ShutdownServices     = $true
                BinaryInstallDays    = "sat", "sun"
                BinaryInstallTime    = "12:00am to 2:00am"
                Ensure               = "Present"
                PsDscRunAsCredential = $SetupAccount
            }
        }
    }
Clone this wiki locally