Ben Hunter

Architect - Microsoft Enterprise Services - Redmond

Deployment 4 - UPDATE - How to create a custom task sequence

Deployment 4 - UPDATE - How to create a custom task sequence

  • Comments 14
  • Likes

I have previously mentioned how to create a custom task sequence to save time when testing application installation in BDD 2007.

You will find the article here.

There are two problems you could run into when using this process with Deployment 4.

  1. If you create a custom task sequence based on a REPLACE template then it fails saying it cannot find \distribution$\control\ts.xml
  2. If you use a different template then I get an error saying you haven’t specified a deploymenttype value.

These problems are caused by checks put in place to verify the type of task sequence being executed. This design essentially means that you cannot use a custom task sequence unless you include an “Install Operating System” task in the task sequence.

Don't worry, there is no need to despair...... I have a solution.

  1. Simply add an “Install Operating System” task to your the task sequence and then you can disable it.
  2. Never use a Replace template to create your custom task sequence.

The task sequence and the process will then function as it would in BDD 2007.

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use.

Comments
  • PingBack from http://blogs.technet.com/benhunter/archive/2007/02/26/how-to-manually-use-a-bdd-task-sequence-to-test-application-installation.aspx

  • So - Deployment 4 - very cool...but I bet your thinking "how can i use the task sequences that I built

  • I am often asked how to setup a custom task sequence that will continue after a reboot. If you have created

  • I am often asked how to setup a custom task sequence that will continue after a reboot. If you have created

  • Hi Ben, I have a question that sort of relates to the new task sequencer templates... Previously we could define a BuidID (specific image) to a role/computer.  Now that the images are now defined in a task sequencer template, how do we assign a specific template to a role or computer using litetouch?

    Thanks

  • Hi Roy,

    You TaskSequenceID replaces the BuildID property. You can use this in the same way as you used the BuildID.

    If you have a look at the "Toolkit_Reference" document included with the MDT documentation you will find more details.

    Thanks,

    Ben

  • Thanks for the reply.  It seems my version of Deployment 4 was different (4.4.0.286.0) and did not contain those docs. I've installed the latest version and can see that you can now set the TS id via the customsettings.ini which allows a TS per deployment point, but using the previous BuildID we could set an O/S to install per Role/Computer.  Is this still possible? I see no TSID or SkipTSID option in the details section and the BuildID and SkipBuildID as still present (but are no longer used?).

  • Hi Roy,

    Good spotting. Here is what you need to do to work around this problem.

    You need to do is remap the the columns. Here is an example:

    CSettings]

    SQLServer=XXX

    Database=YYY

    TaskSequenceID=BuildID

    SkipTaskSequence=SkipBuild

    This tells ZTIGather to assign the value of the BuildID column to the TaskSequenceID property, and the value of the SkipBuild column to the SkipTaskSequence property.

    Thanks,

    Ben

  • Thanks Ben, spent most of the day trying to figure this one out. It would appear that the wizard for the TS ID's prompt always defaults to the first item.  I had a look at ZTIGather and can see that it looks like the remapping scenario is already accounted for...

    'Provide mapping between BuildID and TaskSequenceID

    If oEnvironment.Item("TaskSequenceID") = "" and oEnvironment.Item("BuildID")<>"" then

    oEnvironment.Item("TaskSequenceID") = oEnvironment.Item("BuildID")

    End if

    If oEnvironment.Item("SkipTaskSequence") = "" and oEnvironment.Item("SkipBuild")<>"" then

    oEnvironment.Item("SkipTaskSequence") = oEnvironment.Item("SkipBuild")

    End if

    If you set the buildid to match the TS template you want and then set SkipBuild to yes, then the correct value is applied (check variables.dat).

  • Hi Ben, I think I've found the issue..from line 517 of the DeployWiz_Initialization.vbs file there is a line that tries to match the TSGUID of the selected TSID.. but it looks like oproperties("TSGuid") is never set before we reach this:

    For each oInput in oTSList

    If oInput.Value <> "" and StrComp(oInput.Value,ForceAsString(oproperties("TSGuid")),vbTextCompare) = 0 then

    document.all.item(oInput.SourceIndex - 1).click

    ButtonNext.Disabled = FALSE

    bFound = TRUE

    End if

    Next  

    If I manually add the TSGuid of the TSID that has been set in the details screen (by using oProperties("TSGuid")="{4234-242-etc}") then the correct option is selected in the options list.

  • Ok, I'm new to creating custom task sequences. How could I create a script that would get computer model information, map a drive, and then copy a file based on the computer model information?

  • Hi Fred,

    BDD/MDT do this for you by default. I would suggest looking at the following two blog posts:

    1. How to write a custom script - https://blogs.technet.com/benhunter/archive/2007/04/15/bdd-2007-ndash-tips-and-tricks-ndash-how-to-write-a-custom-script.aspx

    2. How rules work - https://blogs.technet.com/benhunter/archive/2007/03/17/understanding-bdd-rule-processing.aspx

    Thanks,

    Ben

  • Hi,

    Perhaps I missunderstood the instructions provided in this post but I can't get it to work!

    I'm using deployment 4 and made a Custom Task sequence. I added an operating system task and disabled that.

    From a CMD I start \\servername\distribution$\scripts\litetouch.vbs and I get the opportunity to pick my "Install Application" task. I get to "Choose a migration type" - I pick upgrade and I get to set time zone etc. settings. After that I get to select applications and I pick my test application. It breaks down when I get the "Specify Credentials for connecting to network shares". It says "Invalid Credentials. Network path is not found (80070035). I'm quite sure I entered the correct credentials, but where does the network path come from? I started the script from the \distribution$ share so evidently I can connect!

  • Hi Johan,

    The network connection settings are stored in the Bootstrap.ini file.

    You no longer to include a disabled OS task. The MS Deployment guys fixed that before it was released.

    Thanks,

    Ben