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 to that I have also 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.
The latest version of current branch showed the below warning when I ran the old script. I have updated the script and you shouldn’t see the below warning message.
WARNING: Use of Set-CMDistributionPoint cmdlet for creating or modifying multicast service point roles has been deprecated and may be removed in a future release. Set-CMMulticastServicePoint cmdlet should be used instead.
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 Configuration Manager cmdlet library updated. While this is not a complex script, let’s me highlight the important commands.
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.
.SYNOPSIS Install Distribution Point role using PowerShell Script .DESCRIPTION This scripts lets you install the Distribution Point role on a server, Enable PXE, PXE password and Multicast options. .PARAMETER DistributionPoint This the server name where you would be installing Distribution Point role. .PARAMETER SiteCode This is the 3 letter site code. .PARAMETER PXEpass This is the PXE password. .NOTES Version: 2.0 Published Date: 08-December-2016 Updated Date: 18-August-2019 Author: Prajwal Desai Website: https://www.prajwaldesai.com Post Link: https://www.prajwaldesai.com/install-sccm-distribution-point-using-powershell-script/ #> #Load the Configuration Manager Module import-module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\ConfigurationManager.psd1') $Drive = Get-PSDrive -PSProvider CMSite CD "$($Drive):" #Site Code and Distribution Point Server Information $SiteCode = 'IND' $DistributionPoint = 'CORPSCCM.PRAJWAL.LOCAL' #Install Site System Server New-CMSiteSystemServer -ServerName $DistributionPoint -SiteCode $SiteCode #Optional - Install SCCM IIS Base components #dism.exe /online /norestart /enable-feature /ignorecheck /featurename:"IIS-WebServerRole" /featurename:"IIS-WebServer" /featurename:"IIS-CommonHttpFeatures" /featurename:"IIS-StaticContent" /featurename:"IIS-DefaultDocument" /featurename:"IIS-DirectoryBrowsing" /featurename:"IIS-HttpErrors" /featurename:"IIS-HttpRedirect" /featurename:"IIS-WebServerManagementTools" /featurename:"IIS-IIS6ManagementCompatibility" /featurename:"IIS-Metabase" /featurename:"IIS-WindowsAuthentication" /featurename:"IIS-WMICompatibility" /featurename:"IIS-ISAPIExtensions" /featurename:"IIS-ManagementScriptingTools" /featurename:"MSRDC-Infrastructure" /featurename:"IIS-ManagementService" #Install Distribution Point Role write-host "The Distribution Point Role is being Installed on $DistributionPoint" Add-CMDistributionPoint -CertificateExpirationTimeUtc "October 10, 2025 10:10:00 PM" -SiteCode $SiteCode -SiteSystemServerName $DistributionPoint -MinimumFreeSpaceMB 1024 -ClientConnectionType 'Intranet' -PrimaryContentLibraryLocation Automatic -PrimaryPackageShareLocation Automatic -SecondaryContentLibraryLocation Automatic -SecondaryPackageShareLocation Automatic #Define PXE Password $PXEpass = convertto-securestring -string "password" -asplaintext -force #Enable PXE, Unknown Computer Support, Client Communication Method Set-CMDistributionPoint -SiteSystemServerName $DistributionPoint -SiteCode $SiteCode -EnablePxe $True -PXEpassword $PXEpass -PxeServerResponseDelaySeconds 0 -AllowPxeResponse $True -EnableUnknownComputerSupport $True -UserDeviceAffinity "AllowWithAutomaticApproval" -EnableContentValidation $True -ClientCommunicationType HTTP #Enable Multicast Feature Add-CMMulticastServicePoint -SiteSystemServerName $DistributionPoint -SiteCode $SiteCode
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 using dism method. Since this is optional, you could choose to skip this because it’s done by SCCM. Here is a 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 the Add-CMMulticastServicePoint cmdlet, 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.