none
Pre-populate Computer Description field in Wizard RRS feed

  • Question

  • Hi folks!

    I currently have DeployWiz_ComputerName.xml extended to allow for providing a Computer Description during deployment and this description is added to the computer object in AD without issue. My question is whether or not I can prepopulate the field with specific text for my deployment engineers using a variable in CustomSettings.ini?

    Something like:

    Description=Text I want to prepopulate

    I've tried this and it of course does not work.

    Any suggestions?

    B-

    Saturday, September 30, 2017 4:12 PM

Answers

  • If you wish to go down the CustomSettings.ini route, you need to tell MDT to actually pull data from CustomSettings.ini via the Initialize function.

    I just took a look at DeployWiz_ComputerName.vbs, the initialize function looks like this:

    Function InitializeComputerName
    
    	If oProperties("OSDComputerName") = "" then
    		OSDComputerName.Value = oUtility.ComputerName 
    	End if
    
    	If UCase(oEnvironment.Item("SkipComputerName")) = "YES" then
    		OSDComputerName.disabled = true
    	End if
    
    End Function


    Something along these lines might work for you, just add this line before End Function and adjust it for your use case:

    YourProperty.Value = oProperties("YourProperty")
    

    Basically this line should query the value collected during the initial Gather sequence and set the input box to this value.

    Alternatively you could try assigning default value to the input box... since MDT is using HTML, something like this might work:

    <input type="text" name="fname" value="John">


    Cheers,
    Anton

    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    • Marked as answer by BMiller-RLS Sunday, October 1, 2017 12:35 AM
    Saturday, September 30, 2017 7:52 PM

All replies

  • If you wish to go down the CustomSettings.ini route, you need to tell MDT to actually pull data from CustomSettings.ini via the Initialize function.

    I just took a look at DeployWiz_ComputerName.vbs, the initialize function looks like this:

    Function InitializeComputerName
    
    	If oProperties("OSDComputerName") = "" then
    		OSDComputerName.Value = oUtility.ComputerName 
    	End if
    
    	If UCase(oEnvironment.Item("SkipComputerName")) = "YES" then
    		OSDComputerName.disabled = true
    	End if
    
    End Function


    Something along these lines might work for you, just add this line before End Function and adjust it for your use case:

    YourProperty.Value = oProperties("YourProperty")
    

    Basically this line should query the value collected during the initial Gather sequence and set the input box to this value.

    Alternatively you could try assigning default value to the input box... since MDT is using HTML, something like this might work:

    <input type="text" name="fname" value="John">


    Cheers,
    Anton

    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    • Marked as answer by BMiller-RLS Sunday, October 1, 2017 12:35 AM
    Saturday, September 30, 2017 7:52 PM
  • Anton,

    Your last suggestion (<input type="text" name="fname" value="John">) worked beautifully - I had been overthinking this!

    Thanks again,

    B-

    Saturday, September 30, 2017 8:21 PM
  • It shouldn't. Check BDD.log to see how your variables are being set.

    Cheers,
    Anton

    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    Saturday, September 30, 2017 8:56 PM
  • Upon further testing, this breaks applying the computer name. The computer that is typed into the Wizard is no longer applied and it keeps the dynamically generated name.

    Will keep digging,

    B-

    Saturday, September 30, 2017 8:58 PM
  • Apparently, I was wrong. I suppose my excitement at seeing the Description pre-populated, I forgot to update the Computer name in the previous test. Another test confirmed that after updating the computer name field, it didn't break that functionality.

    Thanks again!

    B-

    Saturday, September 30, 2017 8:59 PM
  • Great. Glad I could help. If your question has been answered, please mark the helpful post as answer in this thread so that other community members who encounter the similar issue as yours can find the solution here more efficiently.

    Cheers,
    Anton

    Vacuum Breather Blog | Wing Commander Saga | Twitter

    Note: Posts are provided "AS IS" without warranty of any kind. If posts are helpful please don't forget to rate them as "Helpful" or as "Answer".

    Saturday, September 30, 2017 9:14 PM