Quantcast
Channel: GARYTOWN ConfigMgr Blog
Viewing all articles
Browse latest Browse all 206

Run Scripts: Trigger Task Sequence

$
0
0

Goal: Trigger Task Sequence remotely via Run Script. Allows you to trigger on one computer or several. *The Policy for the Task Sequence most already be on this machine.

Choose a Collection / Computer and Run Script

Type the Package ID for the Task Sequence you want to trigger on the machines:

You can Hover over for more info:

This machine doesn't have that TS Package ID available to Trigger - Results return quickly
This machine Triggered, and has successful confirmation of the TS starting in the execmgr.log
This one triggered, but the TS could not start because of a MW
This machine Triggered, but failed to register that it started the TS in execmgr

The Return information is LIMITED to a couple scenarios I check for.
Process:

  • Check for Task Sequence on Machine with Package ID
  • Trigger Task Sequence
  • Wait 2 Minutes
  • Check ExecMgr Log for:
    • Successful launch of TS with Package ID
    • Waiting for MW
  • If neither of those options are found in the log, it Reports "Failure"**
    • This can be a false positive... Example... If you have the TS set to download content before starting, it could still be downloading the required content after you triggered it... so eventually the TS might still kick off after the content has downloaded.

For more details you'll need to dig through the execmgr and other logs.

Now... the script:

View the code on Gist.

Let me know if you use it and how it goes... GARYTOWN.COM
PS... special shout out to Jeff Scripter for the Function I use to parse the execmgr log.


Viewing all articles
Browse latest Browse all 206

Trending Articles