Insights Disabling Prestaged Content on SCCM Distribution Points With PowerShell

Disabling Prestaged Content on SCCM Distribution Points With PowerShell

I recently worked with a customer to deploy a large number of Distribution Points (DPs).  We had good timing on the project, because the customer also was deploying new virtualization hosts at the same time.  This allowed us to create prestaged content and include in the VM templates sent on the hosts, so that the DPs did not need to sync that content over the WAN after they were built.  Once the prestaged content was loaded on the DP, we would disable prestaged content and the DP would sync future content normally.

This plan worked well and saved us days of syncing content over slow connections, but we ran into an issue.  We ended up generating and sending multiple versions of the prestaged content as the objects in SCCM changed.  On some DPs, we found packages with a distribution status of “waiting for prestaged content” even after prestaged content was disabled.  We used the following script to resolve this by redistributing packages with errors or that were “waiting for prestaged content” when we disabled prestaged content on each DP.

One note on using this script.  It will find and check all of the DPs in your SCCM site based on a naming convention.  You can use just * if you don’t have consistent naming, but it better to limit it if you can.  In any situation, it can take several minutes to build the array with all of the DPs, depending on the size of your environment.  Go ahead and let it run for a few minutes and then you should see it start to process the DPs.  As always, you can monitor the log file with CMTrace to see the progress.