This post introduces you to a script that helps you install SCCM distribution point using PowerShell script. I have been working on this script since couple of days. Finally I have got it working and excited to share with everyone. Creating a distribution point in SCCM is not a tough task, you could that using a wizard. However using PowerShell script, this can be done more easily and quietly. Furthermore this script allows you to enable PXE, specify the password and also enable Multicast on Distribution Point. I will explain what this script does, the script is available for download here. In addition i have pasted the script below, you could copy and save it as well. Ensure you are running SCCM 2012 R2 SP1 and above for this script to work. I have tested this script on Configuration Manager current branch versions 1511, 1606, 1610.

Here is a video that shows how to install sccm distribution point using powershell script.

Install SCCM Distribution Point Using PowerShell Script

The below script allows you to install sccm distribution point using powershell cmdlets. Also ensure you keep your confimgr cmdlet library updated. While this is not a complex script, let’s dig this line by line.

Most noteworthy, before you use this script you need to specify the values for the below :-

$SiteCode – Provide the site code (3 alphanumeric characters).

$DistributionPoint – Specify the server FQDN where you want to install DP role.

$PXEpass – Specify PXE password.

Script Explanation

First of all we import the Configuration Manager module. To import the Configuration Manager module, you will have to specify the path to the Configuration Manager Module.  This is done using import-module command. In the second step we install site system server. Before you install distribution point role, this step is required. To add new site system server we use New-CMSiteSystemServer command.

The next step is optional. The command installs the IIS base components required for DP usin dism method. Since this is optional, you could choose to skip this because it’s done by SCCM. In addition here is another post that shows the installation of IIS components for SCCM.

In the next step we install the DP role using Add-CMDistributionPoint cmdlet. This cmdlet creates a distribution point on a site system server. However this cmdlet has got plenty of parameters that we can supply. So the parameters that we specify with this cmdlet are:-

CertificateExpirationTimeUtc – Date and time when the certificate expires.

ClientConnectionType – Internet / InternetandIntranet / Intranet.

PrimaryContentLibraryLocation, PrimaryPackageShareLocation – Set to Automatic.

SecondaryContentLibraryLocation, SecondaryPackageShareLocation – Set to Automatic.

MinimumFreeSpaceMB – Free size in MB on a drive before SCCM chooses a different drive and continues the copy process to that drive.

In the next step we specify the PXE password. We use convertto-secure string to convert plain text to secure strings rather leaving it plain. Furthermore we enable PXE, Unknown Computer Support, Client Communication Method using Set-CMDistributionPoint cmdlet.

In the last step using Set-CMDistributionPoint, we enable Multicast feature on distribution point.

Finally to run this script, launch the Windows PowerShell ISE. Click on File > Open > browse and locate the script. Also specify the site code, DP, PXE pass and you are good to install DP.

Install SCCM Distribution Point Using PowerShell Script

8 COMMENTS

  1. Prajwal, semantics point: you could tidy up your optional dism command with Add-WindowsFeature cmdlet. (May or may not need to Import-Module ServerManager) (In my example I have all the prereqs for all the roles, but you need only pick out the ones necessary for a DP role) (Also Add-WindowsFeature supports -Computer parameter, so you could run your whole script from an admin workstation) (Additional benefit, you don’t have to specify packages for dependencies, they are installed automatically, this list is specifically for 1511 reqs but should work for all)

    Add-WindowsFeature -Name NET-Framework-Features,NET-Framework-Core,BITS,BITS-IIS-Ext,BITS-Compact-Server,Web-Server,Web-WebServer,Web-Common-Http,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-Static-Content,Web-Http-Redirect,Web-App-Dev,Web-Net-Ext,Web-Net-Ext45,Web-ASP,Web-Asp-Net,Web-Asp-Net45,Web-CGI,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Custom-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Http-Tracing,Web-Performance,Web-Stat-Compression,Web-Security,Web-Filtering,Web-Basic-Auth,Web-IP-Security,Web-Url-Auth,Web-Windows-Auth,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,Web-Lgcy-Mgmt-Console,Web-Lgcy-Scripting,Web-WMI,Web-Scripting-Tools,Web-Mgmt-Service,RDC

    with an optional -Verbose and/or -IncludeManagementTools

  2. Hi Prajwal,

    If i have 2 location with different domain,and i have SCCM in 1 location. so can i use my sccm to deploy patch to other location.If yes then how?

  3. This code no longer works without changes. The “New-CMSiteSystemServer command now uses the parameter -SiteSystemServerName instead of -ServerName
    Tested with 1702…

LEAVE A REPLY

Please enter your comment!
Please enter your name here