Huge thanks to Keith Garner for answering my questions and showing me this function. Thanks Keith!
I was recently working with a client that had some custom scripts they wanted to use to run some processes. What they wanted was to be able to update the Task Sequence progress bar with the progress of those scripts or actions, instead of a single “custom action” being displayed with no progress. It turns out that by using the oLogging.ReportProgress you can control the progress bar and what is presented by using oLogging.CreateEntry to control the display name.
Normally the Task Sequence progress bar only shows the main action.
There is actually built-in logic to allow you to display the progress of individual tasks. The below is an example of displaying “Installing Adobe Reader” with a 5% progress bar. I used oLogging.CreateEntry to display “Installing Adobe Reader” and then oLogging.ReportProgress to show a 5% progress bar.
Using oLogging.ReportProgress I can tell it to display a 75% progress bar as well.
This can be used to show the progress of your custom scripts or actions, along with showing what is happening in that custom script using the logging functions. The script you want to run to show this progress needs to be a .wsf that uses ZTIUtility.
Here is a sample TS to run our custom script. I have 2 pause steps before and after just run something else along with our custom action. This is a good practice when testing so you can see that something before and after ran successfully.
If we run this TS on our machine, we’ll see the progress bar show up and it will through updating the progress and then continue to execute the TS.
Another example allows us to control when the progress is updated. This script waits for updates to some registry keys before it updates the progress.
When we run this Task Sequence on a client, it’ll sit at this screen until we provide it with values.
If we update the registry values, then we can control the display.
The Task Sequence progress is automatically updated as it read the values in the registry we are monitoring. So in this example you could pipe some values out to these values from your custom script (called by the .wsf) and therefore update the TS progress. When your custom script is done, you can just pipe “Done” to the registry and it will end the TS step and proceed to the next step.
I’ve attached my sample scripts to this post. Also, I’d recommend you read Michael Niehaus’s post on Hiding (and showing) the task seqeunce progress dialog box for further information on the topic.
Leave a comment