Mundy

IT Knowledge Base

User Tools

Site Tools


Sidebar

Contact me at dan@mundy.co for any feedback or suggestions.


My other sites:

Search all my sites:

redistribute_content_to_distribution_point

Redistribute content to Distribution Point

You can use this PowerShell function to force failed packages to retry.

Source: https://social.technet.microsoft.com/Forums/en-US/cb61182a-d29c-4a59-8601-fe82c0118de1/redistribute-content-to-distribution-point-w-powershell-cmdlet

RefreshDP.ps1
Function Refresh-SpecificDP {
    param( 
        [Parameter(Position=1,Mandatory=$true)]$siteCode, 
        [Parameter(Position=2,Mandatory=$true)]$packageID,
        [Parameter(Position=3,Mandatory=$true)]$dpName
 
    )
 
    $dpFound = $false
 
    If ($packageID.Length -ne 8)
    {
        Throw "Invalid package"
    }
 
    $distPoints = Get-WmiObject -Namespace "root\SMS\Site_$($siteCode)" -Query "Select * From SMS_DistributionPoint WHERE PackageID='$packageID'"
 
    ForEach ($dp In $distPoints)
    {
        If ((($dp.ServerNALPath).ToUpper()).Contains($dpName.ToUpper()))
        {
            $dpFound = $true
 
            Try {
                $dp.RefreshNow = $true
                $dp.Put() | Out-Null
                $dpName + " - " + $packageID
                }
 
            Catch [Exception]
            {
                return $_.Exception.Message
            }
        }
    }
    If ($dpFound -eq $false)
    {
        Throw "No results returned."
    }
}

Then you need to load the function, and call it. (note the two steps required!)

PS D:\Mundy> . .\RefreshDP.ps1
PS D:\Mundy> Refresh-SpecificDP -siteCode MUN -packageID MUN00050 -dpName SCCMSERVER.MUNDY.LOCAL
redistribute_content_to_distribution_point.txt · Last modified: 2018/04/09 09:56 (external edit)