Automatically Populate Config.xml file Path During OSD Deployment

UPDATE:

A colleague Michael Murgolo  recently updated this script to include a USMTConfigFile switch incase you want to pass different config.xml files into the script.  Attached is the updated script and thanks a lot Michael for the contribution.

Problem:

During an OSD Deployment you may want to use a Config.xml file with USMT generated with the /genconfig command line option when running scanstate to modify the migration scenario from a source computer.  For more information about these options
refer to the TechNet documentation at this Link.

The problem is that you need to specify a full path to the config.xml file which can be different depending on which Distribution Point the USMT package is being ran from.

Solution:

I wrote a script based on a previous post by Michael Murgolo which will grab the “OSDMigrateAdditionalCaptureOptions” and “OSDMigrateAdditionalRestoreOptions” Properties and update them with the /Config: Switch and the current Config.xml
file path location from the Distribution Point that your USMT Package is being called from.  See below for the code and a step by step on how to get this going.

1)     Copy the script attached to this post and the ZTIUtility.vbs to the root of the MDT USMT Package you are referencing in your task sequence and update your distribution point.

2)     Ensure that your Config.xml for each architecture is placed into the correct folder in your MDT USMT Package and update your distribution point.

3)     Set your “OSDMigrateAdditionalCaptureOptions” and or “OSDMigrateAdditionalRestoreOptions variables with any additional command line options you want.

4)     After you set your extra command line options add a new “Run Command Line” option.

       a) Give it a name i.e. “Configure USMT ConfigFile Path”

       b) Set the Command line: “cscript ConfigMgrUSMTConfigFilePath.wsf”

       c) Reference your MDT USMT Package

5)     In the Capture User State step ensure to add any additional Configuration files you used when creating the Config.xml in my scenario I used “Migdocs.xml and MigApp.xml”

6)     Now when you run your Task Sequence you should see a new log file ConfigMgrConfigFilePath.log that should log all relevant details.

7)     You should now see your scanstate or loadstate log populated with the correct command line and the full path to the Config.xml file.

 

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 .

 Sample Script Attached:

 

 

ConfigMgrUSMTConfigFilePath.zip