SCCM Configmgr 2012 Powershell Script: Redistribute Multiple Packages to single Distribution Point

In my Previous blog,I posted script On How to Refresh/Redistribute One package on List of Distribution Points

This post talks about how to Refresh / Redistribute list of packages to Single distribution Point.

import-module F:\sccm\AdminConsole\bin\ConfigurationManager.psd1
#Change the site Code
$SiteCode = "P01"
#provide the path list of packages to be Refreshed
$packages =GC "C:\scripts\pkglist.txt"
foreach ($package in $packages)
#Provide the DP server Name to be refreshed ON
$Server = "CM12DP01"  #host name is enough,no FQDN is required
$pkgs = Get-WmiObject -Namespace "root\SMS\Site_$($SiteCode)" -Query "Select * From SMS_DistributionPoint WHERE PackageID='$Package' and serverNALPath like '%$Server%'"
foreach ($pkg in $pkgs)
$pkg.RefreshNow = $true
# "Pkg:" + $package + " "+ "Refreshed On" + " "+ "Server:" +$server | Out-File -FilePath C:\Scripts\server-refresh-results.txt -Append

For troubleshooting,monitor distmgr.log,sender.log(for primary or secondary), pkgxfermgr.log (for Remote Distribution Points).

To get the package compliance status on all the Distribution Points ,refer SSRS SQL code

Leave a Reply