Using PowerShell to Rerun an SCCM Client Advertisement

I wrote the following function to rerun an advertisement on a remote client computer using either the AdvertisementID or the PackageID. Like all sample code found online, please run through a test environment first, and use at your own risk!

FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmail

5 Comments

  1. Going to test this today, just curios what happens when I rerun a package that has several programs deployed (an install line and uninstall line) will it run the install then the uninstall afterwoods? or can you specify which program ID to run?

    Reply
    • Great question, Nat! Right now it’d run all of them but what a great idea for an improvement!

      Reply
  2. Great script. How long until the advertisement begins to run? Does App deployment need to run to kick off the updated trigger schedule?

    Reply
    • Hey Justin, thanks! The advertisement will begin immediately if it’ll run from the DP or is already in the cache, otherwise it’ll run after it’s re-cached. Since it’s an advertisement and not a deployment, App Deployment will not need to run. In other words, this is for packages/programs and not applications.

      Reply
  3. Thanks Chris, I can see this script being very useful.

    i’m curious if there is a way to retrieve the names of the Distribution Points that are sent back to the client when it requests DPs from the MP. I have been digging through the various WMI classes and name spaces on the SCCM client, but I can’t seem to find a way to do this via WMI or PowerShell.

    Seems like the only way I have found to do this is to search through the LOG files.

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.