Friendly names when Selecting the Domain OU in MDT 2010 December 11, 2009Posted by keithga in MDT 2010, VBscript.
Came across a question in a forum recently:
In MDT 2010 when I am in the Deployment Wizard I can select the option to join a domain, enter in my domain and near the bottom I have the option to select my OU with a dropdown menu.
Within my control folder of my deployment share I have a file called DomainOUList.xml that has a long list of all the OUs I want our techs to be able to select from. The structure of the file looks something like this:
How can I make it look like this:
Laptops / Accounting / Calgary / MYDOMAIN
I did some investigation, and discovered that MDT lacks the ability to display Friendly names in the Domain OU selection on the dialog box. This is a problem all the way back to BDD 2007.
Something I forgot to do.
It s quick change to DeployWiz_Initialization.vbs to make the wizard display friendly names rather than the OU style.
First we introduce a new set of functions:
Function AddItemToMachineObjectOUOpt(item) AddItemToMachineObjectOUOptEx item, itemEnd function Function AddItemToMachineObjectOUOptEx(item,value) Dim oOption set oOption = document.createElement("OPTION") oOption.Value = value oOption.Text = item MachineObjectOUOptional.Add oOption MachineObjectOUOptionalBtn.style.display = "inline"End function
I personally like to add *EX style function like this, it means that we can reduce the number of changed lines in the code, and keep the old version of the function around for compatibility.
Then later on we modify the code to read the DomainOUList.xml:
iRetVal = oUtility.FindFile( "DomainOUList.xml" , sFoundFile) if iRetVal = SUCCESS then For each oItem in oUtility.CreateXMLDOMObjectEx( sFoundFile ).selectNodes("//DomainOUs/DomainOU") if oItem.Attributes.getNamedItem("value") is nothing then AddItemToMachineObjectOUOpt oItem.text else AddItemToMachineObjectOUOptEx oItem.text, oItem.Attributes.getNamedItem("value").value end if Next End if
If the DomainOUList.xml file contains a value attribute in the XML file, it will use that for the value, and the node for the Friendly Name:
<DomainOUs> <DomainOU>OU=Desktops,OU=Accounting,OU=Calgary,DC=MYDOMAIN,DC=AD</DomainOU> <DomainOU value="OU=Desktops,OU=Accounting,OU=Calgary,DC=MYDOMAIN,DC=AD" > DomainCalgaryAccountingDesktops </DomainOU> </DomainOUs>
Full sample can be found at:
KeithKeith Garner is a Deployment Specialist with Xtreme Consulting Group