Roll Out New Configuration Manager Distribution Point with PowerShell

Here is a quick example how to install new Configuration Manager Distribution Point with PowerShell. As you see we have many options to expand this script. We can install Windows Server features, reboot it remotely, install additional software etc. It all depends how you wanna install and configure it.

#Import the Module
Import-Module $env:SMS_ADMIN_UI_PATH.Replace("\bin\i386","\bin\configurationmanager.psd1")
$SiteCode = Get-PSDrive -PSProvider CMSITE

#Change the connection context
Set-Location "$($SiteCode.Name):\"

#New DP Information
$DistributionPoint = ‘DP01.4demo4.com’
$SiteCode = ‘PS1’

# Test the connection to server
    Test-Connection `
        -ComputerName $DistributionPoint

# OPTIONAL – Install Windows Server Roles and Features
    Install-WindowsFeature `
        -Name Web-ISAPI-Ext,Web-Windows-Auth,Web-Metabase,Web-WMI,RDC `
        -ComputerName $DistributionPoint

# OPTIONAL – Restart the Server
    Restart-Computer `
        -ComputerName $DistributionPoint `
        -Wait `
        -For PowerShell `
        -Force

# Add new Site System Server
    New-CMSiteSystemServer `
        -ServerName $DistributionPoint `
        -SiteCode $SiteCode

# Add a Distribution Point
    Add-CMDistributionPoint `
        -SiteSystemServerName $DistributionPoint `
        -SiteCode $SiteCode `
        -ClientConnectionType Intranet `
        -MinimumFreeSpaceMB 50 `
        -PrimaryContentLibraryLocation Automatic `
        -SecondaryContentLibraryLocation Automatic `
        -PrimaryPackageShareLocation Automatic `
        -EnablePxeSupport `
        -SecondaryPackageShareLocation Automatic `
        -CertificateExpirationTimeUtc ((Get-Date).AddYears(100))

# Modify the DP
    Set-CMDistributionPoint `
        -SiteSystemServerName $DistributionPoint `
        -SiteCode $SiteCode `
        -ClientCommunicationType HTTP

#Additional steps here
    #Monitor DP Intallation

    #Distribute Content

 

Merry Christmas Smile


Comments (4):

  1. S. D'Souza says:

    Another suggestion would be to assign the boundary group to the DP.

  2. Kaido Järvemets Kaido Järvemets says:

    Yep. If I didnt miss anything, then currently we dont have a cmdlet for that. here is the example that you are looking for – http://cm12sdk.net/?p=511

    Best,
    Kaido

  3. rafal Doloto says:

    If you make a function parameter for boundary group you can pass it as parameter
    Set-CMDistributionPoint -SiteSystemServerName $NewServerName -SiteCode $NewServerSite -AddBoundaryGroupName $BoundaryGroupName -AllowFallbackForContent $false -EnableValidateContent $true -EnableBranchCache $true

Leave a Reply