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!


  • 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.

  • Reply
    January 26, 2019 at 2:33 am

    Hi, I’ve been trying to use the same Invoke-WMIMethod cmdlet in a script of my own that kicks off after my OSD TS. I simply do 3 of these actions, (003, 021, and 121), like so:

    Invoke-WMIMethod -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule -ArgumentList ‘{00000000-0000-0000-0000-000000000003}’ -Verbose 2>&1
    Start-Sleep -Seconds 300
    Invoke-WMIMethod -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule -ArgumentList ‘{00000000-0000-0000-0000-000000000021}’ -Verbose 2>&1
    Start-Sleep -Seconds 300
    Invoke-WMIMethod -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule -ArgumentList ‘{00000000-0000-0000-0000-000000000121}’ -Verbose 2>&1

    For some reason, actions 021 and 121 work fine, but 003 (Discovery Inventory) throws an error. The same problem happens with a couple of other actions I’ve tried. Seems like certain action IDs just don’t work. The error is:

    VERBOSE: Performing the operation “Invoke-WmiMethod” on target “SMS_Client (TriggerSchedule)”.Invoke-WMIMethod : Not found
    At \.ps1:147 char:2
    + Invoke-WMIMethod -Namespace root\ccm -Class SMS_CLIENT -Name Trig …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [Invoke-WmiMethod], ManagementException
    + FullyQualifiedErrorId : InvokeWMIManagementException,Microsoft.PowerShell.Commands.InvokeWmiMethod

    Would you happen to have any wisdom to share about this?
    == Matt

    • Reply
      Adam Gross
      January 26, 2019 at 2:38 am

      Sure do. I haven’t spent any time tracking them down. In place upgrades don’t have the same issue because the SCCM client and policies already exist by the time we run this. For bare metal OSD builds I suspect that you only have access to a few methods just the same as if you manually installed the client and opened the ConfigMgr app from control panel – there are generally on policy retrieval actions until the client is fully provisioned and updated with policies. That’s my guess – I just haven’t taken a deeper look yet.

      • Reply
        February 11, 2019 at 3:51 pm

        Thanks Adam. I’m guessing you’re right. When I manually install the client and immediately open the Control Panel applet, the Actions tab only has “Machine Policy Retrieval & Evaluation Cycle” and “User Policy Retrieval & Evaluation Cycle”. This doesn’t exactly line up with my results, as “Application Deployment Evaluation Cycle” does work, but I’m guessing the basic theory probably explains it and there’s just certain actions that won’t be available until the full client registration. Thanks.

  • Reply
    May 13, 2019 at 9:26 am

    Can you run these while in Provision Mode?
    Or Post Action?

    • Reply
      Adam Gross
      May 13, 2019 at 9:29 am

      I have a required deployment that runs post upgrade. We also toggle out of provisioning mode to run them during the TS then back into provisioning mode. Not sure that’s supported but it seems to work.


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