MDT User Exit script to populate the OSDComputerName variable with the previous machine’s Computer Name

By | November 7, 2013
Share

In a Computer Refresh scenario on an un-encrypted machine, the old Computer Name is stored in plain text in the registry on the local disk.  MDT can pull in this information and toss it into the OSDComputerName variable to hasten your Deployment Wizard.

1. Update your CustomSettings.INI (Rules) to call an external script to populate the OSDComputerName variable.

2. Add the ZTIGrabOldCompName.vbs script to your <DeploymentShare>\Scripts directory.

https://github.com/brianfgonzalez/Scripts/blob/master/ZTIGrabOldCompName.vbs

3. Lastly, test a refresh machine deployment.  The script will log to the BDD.log.

GrabOldComputerNameLogEntries

 

FYI: This script was tested on MDT2013 and MDT2012U1.

 

/Brian G

3 thoughts on “MDT User Exit script to populate the OSDComputerName variable with the previous machine’s Computer Name

  1. Matt

    Hi Brian,
    Great script, can this be incorporated with [DefaultGateway]?

    ‘If’ the machine has been previously built it uses the previous name as per the script.
    ‘If’ it has not then the machine should be labelled with OSDComputerName=%ComputerLocationName% which is a property used e.g.
    [DefaultGateway]
    192.168.2.0=Test

    [Test]
    ComputerLocationName=TE1100

    Looking at the script it uses ‘MDT’. Can this be changed?

    Thanks

    Reply
    1. Brian Gonzalez Post author

      Matt,

      This script is meant to be used within an MDT (Microsoft Deployment Toolkit) CustomSettings.INI file, it is specific to that tool. Are you using this tool? If so, your example is good.

      Reply
      1. Matt

        I am running MDT.
        I have modified the script to work with my requirements.
        Thanks again.

        Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*