SCCM 2012 Powershell Redistribute Failed Packages

I noticed that sometimes a package will not distribute to one of my distribution point.

Does some know if a powershell script is available which:

- found out the packages with the failed status at a distribution point

- redistribute the package to that specific DP

- will do this check for all packages and for all DP's

September 9th, 2013 4:16pm

ConfigMgr usually retries sending packages (or whatever objects) by default. The defaults are 100 retries with a pause of 30min IIRC. So you would have to fix a problem manually in order to fix content distribution.
Here's something to get you started http://cm12sdk.net/?p=629, but I don't think that it will fix the underlying cause.
Free Windows Admin Tool Kit Click here and download it now
September 9th, 2013 5:00pm

Hello,

See this script;

http://www.david-obrien.net/2013/11/20/redistribute-failed-packages-configmgr-dps/

December 19th, 2013 3:40pm

Hi,

I wrote this script for our environment, it beats clicking stuff.

$SiteCode = "ABC"
$PackageState = "3"

$FailedPackages = Get-WmiObject -Namespace "Root\SMS\Site_$($SiteCode)" -Query "select * from SMS_PackageStatusDistPointsSummarizer where state = $($PackageState)"
if ($FailedPackages.Count -gt 0)
{
    Write-Host "There are $($FailedPackages.Count) Failed Packages at the moment."
}
elseif ($FailedPackages)
{
    Write-Host "There is 1 Failed Package at the moment."
}
else
{
    Write-Host "There are 0 at the moment."
}

if ($FailedPackages)
{
    foreach ($FailedPackage in $FailedPackages)
    {
        try
        {
            $DistributionPointObj = Get-WmiObject -Namespace "root\SMS\Site_$($SiteCode)" -Class SMS_DistributionPoint -Filter "PackageID='$($FailedPackage.PackageID)' and ServerNALPath like '%$($FailedPackage.ServerNALPath.Substring(12,7))%'"
            $DistributionPointObj.RefreshNow = $True
            $result = $DistributionPointObj.Put()
            Write-Host "Refreshed $($FailedPackage.PackageID) on $($FailedPackage.ServerNALPath.Substring(12,7)) - State was: $($FailedPackage.State)"
        }
        catch
        {
            Write-Host "Unable to refresh package $($FailedPackage.PackageID) on $($FailedPackage.ServerNALPath.Substring(12,7)) - State was: $($FailedPackage.State)"
            write-host $Error
        }
    }
}
Most of our DP's are now PullDPs.  When they fail, we find that restarting ccmexec and BITS helps a bit before redistributing.

Cheers!

Free Windows Admin Tool Kit Click here and download it now
December 19th, 2013 5:13pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics