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.
— MODIFICATION HERE —
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
1. | Copy & Paste the code below the —Code Snippet— below in this article into a blank text file and save it as ZTECustomConnect.wsf. |
2. | Copy or Move the ZTECustomConnect.wsf script to your scripts folder under your distribution share. |
To add the required Custom Properties to your customsettings.ini or “Rules” tab of your deployment point
1. | Start Deployment Workbench. |
2. | In the console tree, navigate to Deploy->Deployment Points. |
3. | In the details pane, right-click dp (where dp is the deployment point whose customsettings.ini you want to modify), and then click Properties. |
4. | 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. |
5. | 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 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
1. | Start Deployment Workbench. | ||||||||
2. | In the console tree, navigate to Builds. | ||||||||
3. | In the details pane, right-click build (where build is the build whose task sequence you want to modify), and then click Properties. | ||||||||
4. | 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. | ||||||||
5. | 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
| ||||||||
6. | 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
|
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–
' //***************************************************************************
' // ***** 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
Else
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
Else
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