Task Sequence UI versus SMS_TaskSequencePackage contents

For those of you not familiar with this scenario, what happens is that any time you add a new OEM action to the task sequence, it has to check and see if the task sequence currently has any OEM actions, and it branches off and does different things depending on the answer. There are two parts to the task sequence – the UI information, which is a collection of tree nodes with only display information, and the task sequence object in SCCM, which contains all the details of the steps in the task sequence. The problem is that you cannot actually get specific information from the UI controls about what task sequence you’re working on. In other words, there’s nothing in the UI that helps us directly determine what the package ID of the current task sequence is.

The solution that was implemented (who knows, there may be other solutions), is to do the following:
  1. Read the title of the task sequence editor (which contains the title of the task sequence + (localized) “Task Sequence Editor”.
  2. Get a list of all task sequence packages in SCCM and compare the package names to the title from step 1
  3. If we find a match, open the task sequence and compare the steps listed in the task sequence to the steps in our tree control in the UI
  4. If all the steps match, then we have a matching task sequence, and we can now use that to make our changes

So why is this done in such a complicated way?
  • When manipulating the task sequence, we MUST manipulate the actual task sequence object in SCCM. We can’t really manipulate the tree view for useful effects.
  • We can’t directly link the information we have from the UI to a task sequence stored in SCCM, so we have to go circumnavigate the system to get it.
  • We really need to have the task sequence object from SCCM to determine whether or not the task sequence contains OEM steps, because it’s the only definitive way since we can refer to WMI class names instead of node titles (which could be changed in any number of ways by the user). Trying to determine OEM steps by node titles would require a lot of different comparisons.

And why is this issue complicated by the user adding new steps?
  • When the user adds a new step to the task sequence, it adds a new tree node. However, the underlying task sequence object in SCCM is not updated until the user clicks Apply or Ok to save the steps. Therefore, until the user saves the task sequence in the UI, the contents of the UI will never compare to the saved task sequence.

So does the user have to click OK to save the task sequence and close the editor, then re-open the task sequence in the editor every time they add a new OEM step?
  • No. All they have to do is click Apply. Apply will save the steps to the task sequence and the contents will now match the UI.

Is there a way to fix this so we don’t have to go through all of this?
  • I don’t know yet. I am investigating to see if there is something we can do. Believe me, I have given this a lot of my time to try and figure it out with no solution yet.

Last edited Feb 12, 2009 at 10:57 PM by rhearn, version 1

Comments

No comments yet.