Triggering ConfigMgr Client Actions from a Task Sequence

This week, we were working on testing Windows 7 to Windows 10 In-Place Upgrades and ran into an issue where our clients weren’t updating their Operating System version in the ConfigMgr console. After some helpful responses on Twitter, I was able to add a client action trigger step to the end of my Task Sequence. In my production environment, we have a child task sequence that we call that has several client action steps in it including Request Machine Assignments (Machine Policies) {00000000-0000-0000-0000-000000000021}, Hardware Inventory {00000000-0000-0000-0000-000000000001} and now a Discovery Inventory {00000000-0000-0000-0000-000000000003}.

The idea behind this Task Sequence is to create a Run Command Line step for each of the ConfigMgr client schedule IDs. From there, the sky’s the limit. It just seemed like a great way to just get them all into one place for easy access. You can add it to your Task Sequence as a child Task Sequence or even advertise it as a standalone Task Sequence for newly imaged devices. Additionally, if you want to know what each item does or which logs to look into, just Google it. That’s what I did! 🙂

Some people may ask why not just put all of the actions I want into a script. Because I don’t want to. There are scripts out there that do this same thing in Powershell, but I wanted steps that would be easy for anyone to enable/disable without having to dig into a separate script to debug or change things.

Just use caution. Test! Test! Test!


Use with caution and test in your lab first. Also, I have not tested all of these actions. Some of them may be deprecated. The list came from here

Script to Create Task Sequence

I stole the base code for this from Johan Arwidmark’s (@jarwidmark) Creating Task Sequences in ConfigMgr via PowerShell blog post. The script is simple. Customize it as you see fit. It creates a list of actions that get added to an Enabled and Disabled group in a new Task Sequence. The Disabled Group is set to Disabled in the Task Sequence, but each item below it is not, can move steps in and out of the groups in your TS easily once you’ve created the Task Sequence.

You will need to connect to your ConfigMgr site to run this. The easiest way to do that is to open the ConfigMgr Console and click the upper left corner menu. Select Connect vis Windows PowerShell ISE.

Then run the script that pops up. Don’t edit that script! Once in ISE, copy the following code into a new window, customize it and run it.


Once you have run the script, you should end up with a Task Sequence like this:

And entries like this:

You should see entries in your smsts.log like this. Each step has Continue On Error turned on, so you will want to look at the logs to see if the steps are actually working.

Update 6/15/2018

I submitted a PR on GitHub to add all of the schedule codes to the SDK and it got MERGED!

You Might Also Like


  • Reply
    Paul Wetter
    December 17, 2018 at 3:26 pm

    I would suggest a small modification to aviod ambiguous command. Also, many frown upon aliases. Change Sleep to Start-Sleep. On top of the frowny faces from some, I seem to recall an old sleep.exe command that may still hang out in some worlds.

    • Reply
      Adam Gross
      December 17, 2018 at 3:39 pm

      Thanks for the tip Paul. I’ve changed it to Start-Sleep. I needed to update the page anyway to deal with the new WordPress editor changes.

  • Reply
    January 14, 2019 at 9:14 am

    Hey Adam – whats the reasoning for sleeping each command for 2 minutes? Is it so that they don’t “step on each other’s toes” Is it unique to each action? i.e. can some actions be run synchronously and others not?

    • Reply
      Adam Gross
      January 14, 2019 at 10:15 am

      It is arbitrary for the purpose of this proof of concept. I didn’t do any extra testing to see what timeouts were needed for each item.


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