Powershell DSC to install Sharepoint 2013 Prerequisites in Windows 2012 R2 Server

…this post was published on 2016 December 28.

If you would like to install with zero ​touch on a target machine with 2012 R2 OS the prerequisites for Sharepoint server you can do it

First of all you need to setup  the target machine :
1. set the execution-policy to permit unsigned script to run
2. configure the group policy to permit .exe files to run without intervention
User Configuration/Administrative Templates/Attachment/Manager/Inclusion List for Low file types                          ( Edit/Enabled/Specify low risk: .exe / Apply )
3. uninstall if necesarry KB3102467 ( which installed .NET Framework 4.6 – incompatible with Sharepoint 2013 )

    ** in last tests, I can’t uninstall manually this feature, so the workaround is this link


On the main server, the push server​
 1. create a folder in which you’ll download the .zip file
,attached to this post. This file contain following files:
i. –   DownloadSP2013PreReqFiles.ps1 – this file will download from the Internet needed prerequisites files, except 2 of them
ii. –  KB2671763.exe
   iii. – and WcfDataServices56.exe
   iv. – DSC_SP2013Prerequisitesmain.ps1 – the main script
v. –  DSC_SP2013W2012Prerequisites.ps1 –  this file will create .mof files needed for DSC to configure LCM on target machine and to install features and packages as well , when the target machine is a Windows 2012 R2 Server
vi – DSC_SP2013W2008R2Prerequisites.ps1 – for the windows Server 2008 R2

  2. Unzip the zip file on the main/push server

   3. Run DSC_SP2013Prerequisitesmain.ps1 file.

    This script will:

 – create and configure locally a folder where all needed resources for the process will be stored ( you need to provide a name for prerequisites packages , but you can keep the default value c:\sp2013_prerequisites, if you push Enter )
you need to provide the target’s name server
– download from the net the needed files to that folder and will copy files ( ii and iii )
– will chek the operating system on the target machine and will select the specific file which will create mof files ( in our scenario, the target machine is with 2012R2 OS, and so the file it is: DSC_SP2013W2012Prerequisites.ps1
– finally will start the DSC process, will push the config to the target LCM
​​The target machine will reboot 3 times after it is ready to support SP2013 software setup process.

Here is the link to download the resource ​

For more explicit details watch this video


( until the next updates will come )

On line 38,39 please
replace sp2013 by your Domain name
replace “administrator” by a domain admin to permit rw to the shared folder


    New-SmbShare $folder_prerequisites -Path “c:\$folder_prerequisites” -ReadAccess “sp2013\$finalserver$” -Description “Sharepoint 2013 resources” -ErrorAction SilentlyContinue
    Grant-SmbShareAccess -Name $folder_prerequisites -AccountName “sp2013\administrator” -AccessRight Full  -Force

This entry was posted in DSC, Powershell, Sharepoint 2013, YouTube. Bookmark the permalink.