Skip to content

SPProductUpdate

Yorick Kuijs edited this page Jun 13, 2018 · 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 String[] 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

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: This resource retrieves build information from the Configuration Database. Therefore it requires SharePoint to be installed and a farm created. If you like to deploy a new farm and install updates automatically, you need to implement the following order:

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

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