Great post by Daniel Oxly over on The Deployment Guys blog. 

Read the full post and download the script here.

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