Redistribute Specific Package on Specific DP

A simple little script to refresh content on a DP. The script uses a list of PackageIDs (yes even applications have a package id). The script also uses part of the DP server name to identify it.



Import-Module -Name "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1"
cd DEV:

$a = Get-Content "i:\temp\temp.txt"

foreach ($i in $a)
    {  
    $distpoints = Get-WmiObject -Namespace "\\bvlsccmcas\root\SMS\Site_CAS" -Query "Select * From SMS_DistributionPoint WHERE PackageID='$i' AND ServerNALPath like '%PER%'"
    foreach ($dp in $distpoints)
         {
                 $dp.RefreshNow = $true
                 $dp.Put()
         }
    }

Comments

Popular posts from this blog

Intune Hybrid - NDES Cert Issue

Stuck @ "Waiting for user logon"

Triggering a software update install via Powershell