Creating Simple and/or Smart Custom Wizard Panes (Prompts) for MDT using the Wizard Editor.

By | November 18, 2011
Share

Using the Wizard Editor is fairly self explanatory for adding simple wizard panes. In 90%+ deployment scenarios, a simple wizard pane including a couple of radio buttons suffice.

Here is a simple “Department Name” Wizard Pane, which include 2 radio buttons; “IT Department” and “Sales”. After the Wizard is answered, a “DepartmentName” variable is created and populated with either “ITDEPT” or “SALES” based on the wizard selection:

Choose the User Department.

Department Name Wizard

Now lets create a more advanced prompt for that 10% of times when radios are not enough. This prompt will ask for a string named “NewUserName”. It will verify that the string entered is 10 characters in length and only contains letters.

Please enter the System's New UserName.

User Name:

 

Now you must add Functions to the “\Scripts\DeployWiz_Validation.vbs” script to support the Function call (ValidateNewUserName) which performs the string validation.

'''''''''''''''''''''''''''''''''''''
'  Validate NewUserName
'

Function ValidateNewUserName

	' Check Warnings
	ParseAllWarningLabels

	If Len( NewUserName.value ) < 10 then
		InvalidChar.style.display = "none"
		TooShort.style.display = "inline"
		ValidateNewUserName = false
		ButtonNext.disabled = true
	ElseIf IsValidNewUserName ( NewUserName.Value ) then
		ValidateNewUserName = true
		InvalidChar.style.display = "none"
		TooShort.style.display = "none"
	Else
		InvalidChar.style.display = "inline"
		TooShort.style.display = "none"
		ValidateNewUserName = false
		ButtonNext.disabled = true
	End if

End function

Function IsValidNewUserName( NewUserName )

	const IVNAME_TEST = "[a-z]{10}"
	Dim regEx, match, myMatches

	Set regEx = New RegExp
	regEx.Pattern = IVNAME_TEST
	regex.IgnoreCase = true
	
	Set myMatches = regEx.Execute( UCase(NewUserName) )
	If myMatches.Count > 0 Then
		IsValidNewUserName = true
	End If
End function

New User Name Wizard Pane

Only Letters Error

For building custom RegEx expressions, I suggest using RegExBuddy for Windows users and Kodos for Linux users.

-Brian G

One thought on “Creating Simple and/or Smart Custom Wizard Panes (Prompts) for MDT using the Wizard Editor.

  1. Renaud

    Hi Brian,
    Thanks for this tip !
    A few questions about the first pane: is there a vbs file associated to the xml to validate the answer ?
    Did you use the Properties value in the customsettings.ini to declare “DepartmentName”?
    Can you show the xml file where you insert this code ?

    Reply

Leave a Reply

Your email address will not be published.

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.