Wednesday, 14 November 2012

PowerShell - Refresh content on all DP's assigned for a package.

Whilst debugging a large SCCM software updates maintenance script I needed to determine how to refresh the content on all assigned distribution points after an update had been removed from a package. The below code will trigger a distribution point refresh on all assigned DP's immediately. When I get time I will look to turn this command in to a module for easier reuse and piping.

$(Get-WmiObject -ComputerName SCCMServer -Namespace root\sms\site_abc -query "Select * from SMS_SoftwareUpdatesPackage where PackageID = 'xxx00088'").RefreshPkgSource()


No comments:

Post a Comment