SCCM 2012 - Manually Redistribute Package

From JKuloWiki
Jump to: navigation, search

Powershell Script to Re-Distribute Package Manually

I ran in to an issue where the hidden package Configuration Manager Client Upgrade Package was failing to distribute properly upon creating a new distribution point within SCCM 2012.

This script allows you to manually push a package based on the package number and site ID that you use. To be fair, the package will redistribute automatically on it's own but if you want to force it this is one way.

$SiteCode = "Insert Site Code Here"
$PackageID = "Insert Package ID Here"
     $distpoints = Get-WmiObject -Namespace "root\SMS\Site_$($SiteCode)" -Query "Select * From SMS_DistributionPoint WHERE PackageID='$PackageID'"
        foreach ($dp in $distpoints)
                $dp.RefreshNow = $true