Sysprep Password Replacement

  1. 2 months ago

    I'm finding myself a bit confused on how I can automatically insert passwords into sysprep.

    Say I have the following for account creation or autologin:

    <Password>
        <Value>PasswordGoesHere</Value>
        <PlainText>true</PlainText>
    </Password>

    What would my sysprep look like to replace the PasswordGoesHere with the password I want?

    Further - is there a way to replace some arbitrary placeholder? For example adding the password to a commandline argument:

    <CommandLine>net use * \\server\sharedfiles /user:myuser PasswordGoesHere /persistent:yes</CommandLine>

    The docs mention replacing sysprep tags and appear to hint at some form of environment variable replacement using braces but isn't clear enough for me to grasp the syntax or know exactly where to provide the values.

    Thanks!

    Your first example would be something like this. Your opening tag <password> and closing tag </password> but you need to be careful there is no other <password> tag in your sysprep file as it will be overwritten also.

    '
    <Value>PasswordGoesHere</Value>
    <PlainText>true</PlainText>
    '

    If you want to use custom attributes assigned to a computer you can substitute them like this

    '
    <Value>'${cust_attr_1}'</Value>
    <PlainText>true</PlainText>
    '

    Your last example would be something like this, using <commandline> for the tags

    'net use * \\server\sharedfiles /user:myuser' ${cust_attr_1} '/persistent:yes'
  2. clonedeploy

    Jun 2 Administrator Answer

    Your first example would be something like this. Your opening tag <password> and closing tag </password> but you need to be careful there is no other <password> tag in your sysprep file as it will be overwritten also.

    '
    <Value>PasswordGoesHere</Value>
    <PlainText>true</PlainText>
    '

    If you want to use custom attributes assigned to a computer you can substitute them like this

    '
    <Value>'${cust_attr_1}'</Value>
    <PlainText>true</PlainText>
    '

    Your last example would be something like this, using <commandline> for the tags

    'net use * \\server\sharedfiles /user:myuser' ${cust_attr_1} '/persistent:yes'
  3. Great!

    I ended up just using the <Value></Value> elements, as they all need the same value in my file and saw with the other posts that I needed to escape any special characters with four backslashes.

    Thanks for the clarification about custom attributes, it seems obvious now, I don't know why I didn't see that they're not related to sysprep tags.

 

or Sign Up to reply!