Kick-Starting SCCM Advertisements

I managed to beat fellow Deployment Guy Michael Murgolo to the honour of the first post of 2011, so it is my responsibility to wish all our readers a happy new year!  I hope all your 2011 deployment projects go well, and we've all got some good posts lined up over the coming months which hopefully will be useful to you all!


And now to the serious stuff!  I recently had a requirement in a project to kick-start the installation of all SCCM advertisements that were pending for client computers once the LTI deployment phase had completed.  After a bit of poking around and Bing'ing (is this even a verb??) I developed the attached script.  The script basically enumerates all the pending advertisements received by the client computer and then launches them one by one.  To implement the script, I added it to the task sequence as the very last task in the list, then added the following options to the CustomSettings.ini file in order to remove the "Finish" screen from the LTI deployment and automatically logoff the current user when the task sequence was complete:


Don't forget to copy the script to the Scripts folder of your MDT Deployment Share otherwise it will fail completely.  I have tested it fully for the environment I created it in, although you might run into issues in other environments if they differ greatly.  I suspect issues could occur where your own SCCM advertisements use OSD or MDT task sequences, as these might clash with the LTI task sequence if it is still resident when your SCCM task sequences run.  The solution to this would be to use a "fire-and-forget" type of action so that this script launches in the background and MDT continues onto the next task (the final logoff in this case).

You might be asking yourself right now how this script could be useful, because surely any advertisements received by an SCCM client computer would be launched by SCCM automatically at their allocated time, right?  Yes, but this script will launch the non-mandatory ones that normally require user interaction for them to run, as well as any mandatory ones, thus automating the task completely!


This post was contributed by Daniel Oxley, a Consultant with Microsoft Services Spain 

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use.

Comments (10)
  1. Anonymous says:

    Great post by Daniel Oxly over on The Deployment Guys blog.  Read the full post and download the

  2. Anonymous says:

    Les DeploymentGuys viennent de publier un article très intéressant permettant de forcer

  3. Anonymous says:

    Normal 0 21 false false false FR X-NONE X-NONE Les DeploymentGuys viennent de publier un article très

  4. doxley says:

    @dcbarker – i don't see why not.  If you look at the script you'll see that there is a Sub call RunProgram() that accepts the programID and packageID.  If you were to just call that Sub directly passing those parameters it should do what you want.

  5. doxley says:

    @jscoryat – never tried it to be honest.  this script only talks with the local SCCM client software installed.

  6. DaveBarker19 says:


    I was wonder how I could modify to only kick off just one advertisement with say a specific name?

    I use SCCM to image classroom and one of the things I don't like is the process for getting it to re-run a mandatory advertisement but its a pain to go around to the machine and open control panel to run and advertised program and then pick the image that I want. It would be sweet if I could pass the name of the advertisement to the script to automatically kick of the re-image whenever I would like.

    Thanks for the great post!


  7. Anonymous says:

    Good information and downloadable script for kicking off advertisements immediately after OSD. The benefit here is the script will kick off mandatory and nonmandtory advertisements, so the computer gets all the software.…/deploymentguys

  8. Jim Anderson says:

    Hey guys,

    I had a question or two about…/documenting-your-task-sequences-automagically.aspx

    I tried to post but couldn't.. Where am i to put this XML file at??

  9. JSCoryat says:

    This looks great, any suggestions on how to do this remotely?

  10. senthamarai kannan says:

    is that possible to create advertisement through script, if yes, it would be great to share those script please

Comments are closed.

Skip to main content