Refresh Specific Package on Specific DP Using Powershell

Got the following function from Mike Laughlin posted on

Save this function in your PowerShell profile or save it as a .ps1 file and run it to load the function into memory.

Function Refresh-SpecificDP {






$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.”



How to use

Run from powershell : Usage: Refresh-SpecificDP -siteCode xxx -packageID xxxxxxxx -dpName xxxx

Steps followed to execute above powershell command.

1. Open Powershell as Administrator

2. Type “Set-ExecutionPolicy Bypass” and Enter

3. Import SCCM Module “Import-Module “console install path\bin\ConfigurationManager.psd1”

4. Run Saved Funtion “. .\path to file\filename.ps1”

5. Refresh-SpecificDP -siteCode xxx -packageID xxxxxxxx -dpName xxxx


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at

Up ↑

%d bloggers like this: