none
Accessing USERDNSDOMAIN environment variable when installing an application in MDT 2012 task sequence RRS feed

  • Question

  • Hi

    I'm trying to install a salt-minion as part of an MDT deployment (MDT 2012 R1). Part of the installation is to set the name of the Salt minion, which I would like to be the FQDN of the machine.

    I can run a silent installation via a manual command line:

    Salt-Minion-2014.1.11-win32-Setup.exe /S /master=salt /minion-name="%COMPUTERNAME%.%USERDNSDOMAIN%"

    However, when I put this command line into the Quiet Install Command field of the application task in MDT, it does not correctly install. I find that the COMPUTERNAME environment variable has expanded correctly, but USERDNSDOMAIN has not. So the Salt minion will have a name like "WKS-001.%USERDNSDOMAIN%".

    In the task sequence, the "Install Applications" step appears after "Recover from Domain", so I would expect that the computer has joined the domain, so USERDNSDOMAIN would be available.

    I can work around this problem by hardcoding the domain name in the silent install command as "%COMPUTERNAME%.myorg.local", but this isn't ideal.

    Is it possible to retrieve the domain name in an application installation task?

    Alternatively, The domain name has also been set in customsettings.ini as JoinDomain=myorg.local. Is it possible to inject this variable into the application installation task?

    Friday, November 7, 2014 11:45 AM

Answers

  • From what I can tell, UserDNSDomain is only set if you logged in as a domain User, however, MDT will run most of the StateRestore phase under the local Administrator Account.

    You might try to extract out the value some other way.


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

    Thursday, November 13, 2014 12:26 AM
    Moderator

All replies

  • From what I can tell, UserDNSDomain is only set if you logged in as a domain User, however, MDT will run most of the StateRestore phase under the local Administrator Account.

    You might try to extract out the value some other way.


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

    Thursday, November 13, 2014 12:26 AM
    Moderator
  • You're right, this process is done by the local admin, so the domain information would not be available.

    Is it possible to inject the value of JoinDomain, as set in customsettings.ini, into the application installation?


    • Edited by blaffoy Thursday, November 13, 2014 2:10 PM
    Thursday, November 13, 2014 2:08 PM
  • maybe reference this and declare the dns of your mdt/wds server as your own invented variable like %DOMAINNAME%:

    https://social.technet.microsoft.com/Forums/en-US/3960d72e-9dac-4aa7-bc13-6da4b989c83b/how-do-i-get-the-name-of-the-current-deployment-server-dynamically-in-customsettingsini?forum=mdt
    Wednesday, November 26, 2014 8:53 PM