Deployment Artist


The site is finally put to rest...

You find new content on the Deployment Research site, a site filled with articles and video-tutorials on how to deploy operating systems. If you are missing something on the new site, please let me know. You can find me on twitter on my @jarwidmark alias.

You can also search the old article archive below.

Regards / Johan Arwidmark

 Blog_List Minimize

 Blog_Archive Minimize

 New_Blog Minimize
You must be logged in and have permission to create or edit a blog.

 BDD Extension: ZTECustomConnect Minimize
Location: BlogsJason Scheffelmaer    
Posted by: Jason Scheffelmaer 2/15/2007 1:14 PM

During the LTI and ZTI deployment process, you may require access to a network resource that is on a server different from that hosting the deployment point. In order to access resources on another server though you must somehow authenticate to it first. For example, you might want to install an application from a shared folder on a server other than that hosting the deployment point that the BDD 2007 scripts use.

Using the ZTIConnect.wsf script, you can connect to other servers and access resources on them. The syntax for the ZTIConnect.wsf script is as follows (where unc_path is a UNC path to connect to the server):

Cscript.exe “%SCRIPTROOT%\ZTIConnect.wsf” /uncpath:unc_path

In most instances, you run the ZTIConnect.wsf script as a task sequencer task. Run the ZTIConnect.wsf script prior to tasks requiring access to a server other than the server hosting the deployment point.


Unlike ZTIConnect.wsf above, ZTECustomConnect.wsf can be used to connect resources defined in the customsettings.ini instead of the task sequencer command line. It also utilizes custom credentials to connect to these resources as opposed to using the standard defined UserID, UserPassword, & UserDomain properties.

ZTECustomConnect.wsf takes advantage of the Customsettings.ini rules in order to customize the connection to your resources needed for a given location/role/etc. This allows more of a dynamic connection to resources utilizing seperate credentials than those supplied for the distribution share connection (Ex: UserID property, etc).

To add the ZTECustomConnect.wsf script to your scripts folder as an accessible script


Copy & Paste the code below the --Code Snippet-- below in this article into a blank text file and save it as ZTECustomConnect.wsf.


Copy or Move the ZTECustomConnect.wsf script to your scripts folder under your distribution share.

(Ex: \\server1\distribution$\scripts\ZTECustomConnect.wsf)

To add the required Custom Properties to your customsettings.ini or "Rules" tab of your deployment point


Start Deployment Workbench.


In the console tree, navigate to Deploy->Deployment Points.


In the details pane, right-click dp (where dp is the deployment point whose customsettings.ini you want to modify), and then click Properties.


Click the Rules tab, navigate to Properties=  and add the following custom properties:

CustomUNCPath, CustomUserID, CustomUserPassword, CustomUserDomain

Note   Ensure that you add a comma between each custom property.


Set the values of the custom properties in a section that will be processed by your Priorities list at the top of your customsettings.ini

Sample CustomSettings.ini snip...

Priorities=MyApplicationsShare, Default
Properties=CustomUNCPath, CustomUserID, CustomUserPassword, CustomUserDomain


Note: If any of these custom properties are not assigned a value than the ZTECustomConnect.wsf will not process.

To add the ZTECustomConnect.wsf script as a task to the task sequence of a build


Start Deployment Workbench.


In the console tree, navigate to Builds.


In the details pane, right-click build (where build is the build whose task sequence you want to modify), and then click Properties.


Click the Task Sequence tab, navigate to group (where group is the group in which you want to run the ZTECustomConnect.wsf script), click Add, and then click Task.

Note   Ensure that you add the task prior to any tasks requiring access to the target server.


Complete the Properties tab of the new task by using the information in the table below, accepting default values if not otherwise specified, and then click Apply.

Completing the Properties Tab of the New Task

In this box Do this


Type Custom Connect to server (where server is the name of the server to which you want to connect).


Type description (where description is text that explains why the connection needs to be made).

Command line

Type Cscript.exe “%SCRIPTROOT%\ZTECustomConnect.wsf”.


Complete the Options tab of the new task by using the information in the table below, accepting default values if not otherwise specified, and then click OK.

Completing the Options Tab of the New Task

In this box Do this

Success codes

Type 0. (The ZTECustomConnect.wsf script returns these codes upon successful completion.)

Conditions list box

Add any conditions that might be necessary (in most instances this task requires no conditions).

Upon completion of adding the task to run the ZTECustomConnect.wsf script, subsequent tasks can access network resources on the server specified in the CustomUNCPath custom property defined in the customsettings.ini as described ablove.

--Code Snippet--

<job id="ZTECustomConnect">
   <script language="VBScript" src="ZTIUtility.vbs"/>
   <script language="VBScript">

' //***************************************************************************
' // ***** Script Header *****
' //
' // Solution:  Solution Accelerator MOD for Business Desktop Deployment
' // File:      ZTECustomConnect.wsf
' //
' // Purpose:   Connect to a network share using custom properties defined in the customsettings.ini
' //
' // Usage:     cscript ZTECustomConnect.wsf [/debug:true]
' //  Requires The following custom properties to be defined in the customsettings.ini
' //    *  CustomUNCPath
' //    *  CustomUserID
' //    *  CustomUserPassword
' //    *  CustomUserDomain
' //
' // Customer Script Version:     1.0.2
' //
' // Extension History:
' // 1.0.2    JOS  2/20/2007  Updated name to ZTECustomConnect to stand for Zero Touch Extention.
' // 1.0.1    JOS  2/15/2007  Updated name to ZModCustomConnect for OSD autocopy.
' // 1.0.0    JOS  2/15/2007  Created initial version.
' //
' // Customer History:
' //
' // ***** End Header *****
' //***************************************************************************

'//  Global constant and variable declarations

Option Explicit

Dim iRetVal, iCustomUNCPath, objTmpUser, objTmpPassword, objTmpDomain

'//  End declarations

'//  Main routine

On Error Resume Next
iRetVal = ZTIProcess
ProcessResults iRetVal
On Error Goto 0

'//  Function: ZTIProcess()
'//  Input: None
'//  Return: Success - 0
'//  Failure - non-zero
'//  Purpose: Perform main ZTI processing
Function ZTIProcess()

 iRetVal = Success

 oLogging.CreateEntry "Retrieving CustomUNCPath custom property", LogTypeInfo
 iCustomUNCPath = oEnvironment.Item("CustomUNCPath")
 If iCustomUNCPath <> "" Then
  oLogging.CreateEntry "Succefully retrieved CustomUNCPath property", LogTypeInfo
  oLogging.CreateEntry "CustomUNCPath custom property either not found or is empty, exiting ZTECustomConnect.wsf", LogTypeInfo
  ZTIProcess = Success
  Exit Function
 End If

 ' Store the current defined credentials in temporary variables 

 oLogging.CreateEntry "Storing UserID, UserPassword, and UserDomain properties values in temporary variables", LogTypeInfo

 objTmpUser = oEnvironment.Item("UserID")
 objTmpPassword = oEnvironment.Item("UserPassword")
 objTmpDomain = oEnvironment.Item("UserDomain")

 ' Set the standard UserID credentials for ZTIUtility to utilize without modifying ztiUtlity directly.

 oLogging.CreateEntry "Setting UserID, UserPassword, and UserDomain properties to CustomUserID, CustomUserPassword, CustomUserDomain", LogTypeInfo

 oEnvironment.Item("UserID") = oEnvironment.Item("CustomUserID")
 oEnvironment.Item("UserPassword") = oEnvironment.Item("CustomUserPassword")
 oEnvironment.Item("UserDomain") = oEnvironment.Item("CustomUserDomain")

 ' Map a drive to the specified UNC

 If oUtility.ValidateConnection(iCustomUNCPath) = Success then
  oLogging.CreateEntry "Successfully connected to " & oUtility.Arguments("UNCPath"), LogTypeInfo
  iRetVal = Failure
  oLogging.CreateEntry "Unable to connect to " & oUtility.Arguments("UNCPath"), LogTypeWarning
 End if

 ' Set the standard UserID credentials back to their original value

 oLogging.CreateEntry "Setting UserID, UserPassword, and UserDomain properties back to their original values", LogTypeInfo

 oEnvironment.Item("UserID") = objTmpUser
 oEnvironment.Item("UserPassword") = objTmpPassword
 oEnvironment.Item("UserDomain") = objTmpDomain

 ZTIProcess = iRetVal

End Function



Permalink |  Trackback

Your name:
Add Comment   Cancel 

 Search_Blog Minimize

Copyright 2006-2012 (c)   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2019 by DotNetNuke Corporation