none
Task Sequence Execution time RRS feed

  • Question

  • How could I easily get task sequence execution time (from start to finish) to variable that I could use? I'm trying to measure how much it takes time to task sequence complete.

    Friday, October 17, 2014 5:09 PM

Answers

  • $Times = (get-content .\BDD.LOG) -match "(LTI Beginning deployment|LTI deployment completed successfully)" | 
    ? { $_ -match "time=""([0-9][0-9]\:[0-9][0-9]\:[0-9][0-9]).*date=""([^""]*)"""} | 
    %{  get-date "$($matches[2]) $($Matches[1])" }
    $TImes[1] - $Times[0]

    Script to extract out start and finish times from bdd.log file. :^)

    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    • Marked as answer by DamonWH Friday, October 24, 2014 6:52 AM
    Friday, October 24, 2014 6:02 AM
    Moderator

All replies

  • Friday, October 17, 2014 11:32 PM
    Moderator
  • Thanks for that! I still dont know how I could get the total execution time to variable at the end of task sequence. I'm planning a solution that will send email after every deployment and I would like to add time it took to complete the task sequence to the report.
    Saturday, October 18, 2014 6:35 AM
  • I read the blog post and didnt see a way to get the total TS execution time into a variable.
    Monday, October 20, 2014 11:07 PM
  • I'd also like a way to do this as well.

    Is there a way to plug this into a variable, and have it show on the summary page?

    For the moment I've been using a stopwatch app on my phone, but that's not too accurate as I have to literally watch for the summary page to appear.

    Tuesday, October 21, 2014 3:30 PM
  • The Monitoring functionality in MDT will provide Start Time, End Time, and Elapsed Time in the console if that helps with what your trying to accomplish, screenshot below.

    You can also use powershell to get this from the server and even use that to generate html and create a monitoring web page, see instructions and script from Mikael Nystrom here. You could potentially use parts of that script to pull the same info into your email summary. What are you using for your email summary? An orchestrator runbook, script executed at end of the task sequence, or? Some context around that would help in giving some more ideas.


    • Edited by Ryan Dallas Wednesday, October 22, 2014 3:27 PM
    Wednesday, October 22, 2014 3:13 PM
  • $Times = (get-content .\BDD.LOG) -match "(LTI Beginning deployment|LTI deployment completed successfully)" | 
    ? { $_ -match "time=""([0-9][0-9]\:[0-9][0-9]\:[0-9][0-9]).*date=""([^""]*)"""} | 
    %{  get-date "$($matches[2]) $($Matches[1])" }
    $TImes[1] - $Times[0]

    Script to extract out start and finish times from bdd.log file. :^)

    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    • Marked as answer by DamonWH Friday, October 24, 2014 6:52 AM
    Friday, October 24, 2014 6:02 AM
    Moderator
  • $Times = (get-content .\BDD.LOG) -match "(LTI Beginning deployment|LTI deployment completed successfully)" | 
    ? { $_ -match "time=""([0-9][0-9]\:[0-9][0-9]\:[0-9][0-9]).*date=""([^""]*)"""} | 
    %{  get-date "$($matches[2]) $($Matches[1])" }
    $TImes[1] - $Times[0]

    Script to extract out start and finish times from bdd.log file. :^)

    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Thank you Keith!
    Friday, October 24, 2014 6:52 AM
  • Keith:

    My PowerShell skills are somewhat limited and I'm getting this error when I try to run that. What I'm missing?

    

    Friday, October 24, 2014 12:16 PM
  • It looks like $times is null. What do you get when you type $Times?
    Friday, March 13, 2015 10:28 PM
  • Best to learn Powershell

    My script makes assumptions about the location of the bdd log file:

    get-content .\BDD.LOG

    If it is not in the current directory it won't work, best to modify the script so it can find the file.


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Monday, March 16, 2015 7:26 PM
    Moderator