Using special characters in Microsoft Deployment Tool (model name)

Currently we are working at a customer to set up a new environment.
To make this as easy as possible we are using the Microsoft Deployment Tool (MDT)

This will make it very easy to install computers with a new OS and the correct drivers.

However when the targeted computer uses the special characters like “/” in the WMI hostname, MDT runs into problems as the MDT workbench doesn’t allow special characters like “/”

The specified new name must not contain special characters

Before starting I would like to notify that I made this solution together with Jeroen van Roon
And Ingmar Verheij.

In the environment the problem was caused by an Onyx ZEUS-247S PC with the WMI hostname of: ZEUS-197/227/247.

There are 2 ways to solve this.

The quick and dirty way, and the proper and nice way.

First the quick and dirty one. When there is only one model that uses the “/” it can be solved as following:

Go to the MDT server and hunt down the ZTIgather.wsf file (Deployment folder and then in the script folder). Once found open this file and go to “’Get the UUID from the Win32_ComputerSystemProduct class”. Underneath this part add the following line:


If sModel = “Original WMI hostname” then
sModel = “Folder name as used in MDT workbench”
End if


Once this is done the computer will work with MDT.

As said before this is the quick and dirty way and I wouldn’t advice it, unless there is a really good reason. The reason for not using this is if Microsoft updates the script with a Windows Update the changes are discarded.

Ok now for the proper solution.

The best way of course is when in the future al “/” are converted automatically so they work with MDT.

First go to the MDT server and open the Script folder (under Deployment folder)
Here we create a new .wsf file that we are going to edit.

(in my case I was very lucky that Ingmar Verheij already made a file that I could adjust)

Basically in this file should be entered the following.


<job id=”Z-CustomWMImodelRename.wsf”>
<script language=”VBScript” src=”ZTIUtility.vbs”/>
<script language=”VBScript” src=”ZTIConfigFile.vbs”/>
<script language=”VBScript”>

Option Explicit
Dim iRetVal

Dim oOSXMLDom

Dim oOperatingSystem, oOperatingSystems

Dim oOS
On Error Resume Next
iRetVal = ZTIProcess
ProcessResults iRetVal
On Error Goto 0
(The following part is the important part which is going to solve our problem)

Function ZTIProcess()
‘Define variables
Dim sOSDComputerNamePrefix
Dim sOSenable, sOSGUID, sName, sImageFile, sPlatform, sModel, sModelReplaced
Dim sNewOSGUID
oLogging.CreateEntry “Before value: ‘” & oEnvironment.Item(“Model”), LogTypeInfo
wscript.echo oEnvironment.Item(“Model”)
oEnvironment.Item(“Model”) = Replace(oEnvironment.Item(“Model”),”/”,”_”)
wscript.echo oEnvironment.Item(“Model”)
oLogging.CreateEntry “After value: ‘” & oEnvironment.Item(“Model”), LogTypeInfo
End Function

</script>
</job>


What happens is that when the hostname contains a “/” it should be replaced with a “_”

”_” Is accepted by MDT so the computers with “/” in it can be installed with MDT

However there is one final step to be made.

For this we need to open the DeploymentWorkbench

Go to Task Sequences and open the specific job u want to solve

DeploymentWorkbench Deployment Workbench

There u go to Task sequence and make a new job. (make sure u put this job above Configure Out-of-Box Drivers Model!!)

The reason why it needs to be above that job is because when the “Configure Out-of-Box Drivers Model” job starts the computer starts looking at its designated folder for its drivers.

Image deploy Task Sequence MDT

Image Deploy Deployment Workbench MDT

Make sure it runs the correct script.

Once this is done MDT should now work with hostname’s containing “/”

One point of notice from now on if a computers hostname is for example “Computer/1/2/3”

It should be in MDT referred as “Computer_1_2_3”