How can I easily see how long my Deployment Tasks take?

By | October 17, 2018
Share

I created a powershell script that outputs a chart displaying a breakdown on Deployment task durations.

I tested it with MDT, but it should also work with SCCM.

1\Download the https://github.com/brianfgonzalez/Scripts/blob/master/ZTIDurations.ps1 script.


2\Add the .ps1 to your Deployment share’s script directory.

3\Add a call to the script on the top of your Task Sequence with the “-Initial” parameter.

4\Add a call to the script on the bottom of your Task Sequence with the “-Final” parameter. If you want the chart, you’ll also need to pass the “-SaveChart” parameter.

5\Add script calls throughout your Task Sequence to track your desired Deployment Tasks.

5a\For every task, add a call to the script before the task with a “-Start” parameter.

5b\and a call after the step with a “-End” parameter and a “-Step” parameter to label the task in the chart.
* Note: The “-Step” parameter doesn’t accept spaces, so use “_” if you need spacing.

6\Perform a Deployment and review the new files in your logpath directory: Durations.json, Durations.log and Durations.png

/BG

9 thoughts on “How can I easily see how long my Deployment Tasks take?

  1. Xavier Scott

    I followed your instructions, but when I try to use it, I keep getting an error:
    Warning: PowerShell was not detected.
    ZTI ERROR- – Unhandled error returned by ZTIPowerShell: Type mismatch (13)
    Litetouch deployment failed, Return Code = -2147467259 0x80004005

    Reply
      1. Daniel

        Hi Brian,

        When using the ps1 I can get the Durations.log BUT the JSON and PNG are not created. I am using MDT with the PE fix for ADKv2004. But we are not getting any errors so I can’t tell why the JSON is not being created. The PNG needs to JSON right? MDT version 8456, should this work on this version?

        Reply
        1. Brian Gonzalez Post author

          Daniel, TBH, I haven’t tested this script on 2004 PE. One thing I would check is to make sure you have Powershell support added to your Win PE boot image. Can you confirm this?

          /BG

          Reply
          1. Daniel

            Hi Brian,
            Yes we have PS support in the x64 Feature settings: DISM/MDAC/.NET/PowerShell/DART and after imaging I can see ZTIPowershell.log but no errors are shown. Just the durations.log which is fine, but the PNG would be nice also.

            Thanks!

            Daniel

          2. Brian Gonzalez Post author

            Daniel, Now that you mentioned this, I remember this last step that produced the PNG only working if it was run inside of Windows. Can you confirm you are running it from inside of Windows and NOT Windows PE? /BG

          3. Daniel

            Brian,
            Ok I think I understand, but NO not in Windows, the ZTIDurations run in the task sequence during imaging. The END step is in Windows but I never check the logs on the pc itself only in the LOGS folder in the deploymentshare. So the PNG should show up on the pc before the “End Task” Icon is clicked? Is that what you mean in “Windows?” Your first version where it shows duration on the “Final Summary” screen will you be updating that? We really like that so our Techs can see how log it takes? I was wondering about the first

            Daniel
            Thanks!

  2. Rich

    You must right-click your Deploy Share, Properties, WinPE tab, (change to x64 if needed), Features tab, checkmark Windows Powershell

    Reply

Leave a Reply

Your email address will not be published.

*

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