Hijacking the Task Sequence for Monitoring and Alerting

I’ve spent the better part of the last two evenings working on this – and I’m honestly not 100% satisfied but I’ve made some excellent progress thus far that I’ve decided to share. Monitoring a task sequence to me has been a rather manual process – either I get notified by a support tech that a task sequence failed or I happen to see a failure in the monitoring tab of SCCM. This ultimately leads me to request the tech send me the SMSTS.log file, the error code presented, and at which step the task sequence failed. This can sometimes be cumbersome because the techs just aren’t as familiar with SCCM and or the logs associated with it – or sometimes it’s challenging when the machine isn’t joined to the domain yet and the tech doesn’t have a flash drive handy.

So my initial goal was just to launch a monitoring tool in the background of the task sequence that would alert me via email the second a task sequence failed, the step it failed on, the return code of the failed step, and attaching the SMSTS.log file for review. I was able to do this pretty simply with a “Run Command Line” step and a custom monitoring script. The downside to this was that I had to re-run this script at every. flippin. reboot. And there wasn’t even a guarantee that I could do that at every reboot – for example if I have a “Install Applications” step with 20 applications and the application 10 steps in has a reboot, SCCM reboots and then picks up where it left off (this time without the monitoring script running).

Enter the Windows Setup keys…

(more…)

Read More

Task Sequence Variable Series: _SMSTSLastActionSucceeded (BONUS: Task Sequence E-Mail Notification Script)

Conference time! MMS is upon us and it seems conferences and vacations are the only time I get some respite from the busyness of working on our Windows 10 deployment to do a little blogging. While I’m here I’ll be working on a series of posts regarding built-in variables for task sequences and how they might be of benefit to you (or how I use them in my environment). I didn’t even consider submitting a topic for MMS this year, but maybe next year I’ll take the collective learning I invest in built-in task sequence variables and propose a topic. As an aside – if you’re here at MMS and want to chat, hit me up – my schedule is available on Sched if you link up with my Twitter or LinkedIn and link your account to Sched.

Now onto business. The variable we’ll be taking a look at today is _SMSTSLastActionSucceeded. And just as the name implies it reports on whether or not the last action in the task sequence succeeded. Nothing much more to it. From TechNet :

The variable is set to true if the last action succeeded and to false if the last action failed. If the last action was skipped because the step was disabled or the associated condition evaluated to false, this variable is not reset, which means it still holds the value for the previous action.

Read on for how we use this in our environment.

(more…)

Read More

GPOs? Screw it, We’ll do it Live… (Part IV)

We’ve thus far installed and configured AGPM, created our first policy, and at the same time walked ourselves through the approval flow built into AGPM. What happens when we have existing policies though? I’m assuming that if you’re reading this you’re not building GPOs from the ground up (if you are, kudos for implementing good practices up front). This post will cover a few different things:

  1. Importing existing GPOs for management (and discovering a flaw in our existing setup)
  2. Rolling back to a previous version of a policy
  3. Re-syncing policies when they get out of sync

Alright Mr. GPO Manager, let’s get to it!

(more…)

Read More