locked
Variable .wim file (BackupFile) using %TaskSequence% not working for reference image RRS feed

  • Question

  • Hello,

    I am trying to make a semi-automated solution for building reference image. The goal is to just select a task sequence and based on only that input create a reference image and store it on the MDT server as a unique named .wim file. I'm doing almost exactly the same as all the pro's (Johan, Mikael, etc.). What I do is in the CustomSettings.ini I specify BackupFile to be %TaskSequenceID%.wim. My goal with that is to get a .wim file that is called REFWIN81CORENLX64.wim. Instead of that I get %TaskSequenceID%.wim. I'm banging my head against the wall all day now and I have even build another environment to see if the problem occurs there too. It does.. 

    I'm hoping that someone can tell me what Ido wrong.

    Mathijs

    Tuesday, December 2, 2014 7:12 PM

Answers

  • Short Answer:

    You have programmed a race condition into your system.

    Long answer:

    MDT will fill out the TaskSequenceID variable during the MDT LiteTouch Wizard.

    You put the BackupShare variable in your CS.ini file:

    BackupShare=\\MDT02\MDTBuildLab$\%TaskSequenceID%
    

    However, the CS.ini was ALREADY processed *BEFORE* the MDT LiteTouch Wizard. and since TaskSequenceID was set to <BLANK> then Backupshare becomes the value above. ANy attempt to re-parse the cs.ini file will not process BackupShare because ZTIGather.wsf will only pick up the value the first time.

    Instead you should set the BackupShare variable *AFTER* the MDT Litetouch Wizard, if you want to leave it in your CS.ini file, then use Johan's method to re-parse the CS.ini file during the Task Sequence.

    http://www.deployvista.com/tabid/36/EntryID/139/language/en-US/Default.aspx

    -k


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com


    Thursday, December 4, 2014 12:53 AM

All replies

  • Got a log somewhere we can see?  Can you post your customsettings.ini? Only reason I could think off the bat that tasksequenceID is not populated is that ZTIGather.wsf is not gathering that data.
    Tuesday, December 2, 2014 7:45 PM
  • I've uploaded my CustomSettings.ini. Here is the link: http://pastebin.com/FxQixVXw.

    Regarding the log, at which point, what log file are you interested in? 

    Tuesday, December 2, 2014 8:01 PM
  • I was looking to validate in BDD.log that indeed TaskSequenceID was being populated.  The task sequence ID is populated by the gather step and you should be able to validate that data exists in the log.
    Tuesday, December 2, 2014 8:25 PM
  • Strange question - does _smstsorgname populate correctly or is it not populating anywhere currently? 
    Tuesday, December 2, 2014 8:26 PM
  • That's the weird part. There it is populated correctly... 
    Tuesday, December 2, 2014 8:31 PM
  • About the log, how do I get the file (or the contents at least) when I'm in the wizard?
    Tuesday, December 2, 2014 8:45 PM
  • Google says there could be a bug with this feature functionality but I'm not sure honestly.  There are a few guys that are a bit more veteran to MDT than myself and might know if this is still a bug or not.  If it's populating there, is it populating the correct backupdir? 

    Can you also check your gather step and see if this changes if you configure it to gather local data and process rules?  The rules file should be set to customsettings.ini.

    If you need a workaround for now, you could probably echo that %TASKSEQUENCEID% over into another variable that you use specifically for your deployments.  You would need to  Add > Set Task Sequence Variable.  In Task Sequence Variable -- set as a custom name you can then access as %yourvar%.  In the Value: section, set the value as %TASKSEQUENCEID%.  Place it immediately after gather and that variable will be accessible throughout the TS.

    Tuesday, December 2, 2014 8:45 PM
  • Thanks for the tip. However when I set %TSID% to be %TaskSequenceID% (first task in the task sequence, before the CustomSettings.ini) I still get %TSID%.wim. Pretty messed up, let me know if you've got other workarounds or tips. In the meantime I'll just key the values in manually, we only have a few reference images so it's not a big deal. However for my personal educations I'd like to automate as much as possible. So, I guess with this one I'm just a bit out of luck. 
    Tuesday, December 2, 2014 9:02 PM
  • I don't have any ideas at this point, my deployment consists of one image with many exit points so I was never really interested in this functionality having one 32-bit and one 64-bit image.

    How you've written it should work though as I said I was seeing a lot of feedback as to this being a bug in previous versions. I'm not sure if it was fixed.

    Tuesday, December 2, 2014 9:57 PM
  • Try to configure the variable in MDT without the %, otherwise I don't have any guesses on this one.  Sorry.
    Wednesday, December 3, 2014 5:35 PM
  • Short Answer:

    You have programmed a race condition into your system.

    Long answer:

    MDT will fill out the TaskSequenceID variable during the MDT LiteTouch Wizard.

    You put the BackupShare variable in your CS.ini file:

    BackupShare=\\MDT02\MDTBuildLab$\%TaskSequenceID%
    

    However, the CS.ini was ALREADY processed *BEFORE* the MDT LiteTouch Wizard. and since TaskSequenceID was set to <BLANK> then Backupshare becomes the value above. ANy attempt to re-parse the cs.ini file will not process BackupShare because ZTIGather.wsf will only pick up the value the first time.

    Instead you should set the BackupShare variable *AFTER* the MDT Litetouch Wizard, if you want to leave it in your CS.ini file, then use Johan's method to re-parse the CS.ini file during the Task Sequence.

    http://www.deployvista.com/tabid/36/EntryID/139/language/en-US/Default.aspx

    -k


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com


    Thursday, December 4, 2014 12:53 AM