Issue

If "Copy log file" is defined in a project's post-build tasks along with a rename of the local Administrator account then the log file copy may fail to copy to a network share.

This occurs because the credentials used to connect to the network location have been changed in phase4 prior to the copy log file task running.

Requirements

  • Imaging Toolkit build configured with:
    • Copy Log file to network location
    • Rename of local Administrator account
    • Deployment Monitor is not available

Solution

Configure a phase4-before.vbs script to authenticate to the network location where the log file is being copied to.

Procedure


Done Task
 
1. Update phase4-before.vbs script file
 
2. Test



  1. Update phase4-before.vbs script file

    • Launch Build Console

    • Open your project xml file

    • Select "Expert View"

    • Select "Customisations" | "Custom Files"

    • Right click on phase4-before.vbs - then select "Edit"

    • Update the file to reflect the following changes.

      • If credentials are to be specified to authenticate to the network location then update the script below to include the network share details and appropriate credentials

        ' ENGL Imaging Toolkit
        ' Copyright (C) 1999-2017 Expert Networking Group Limited
        
        ' Custom script template (phase4-before.vbs)
        
        ' Attach to ENGL Ztoolkit ActiveX Control
        Set LDAP= CreateObject("ENGL.Ztoolkit.LDAP")
        Set Utils= CreateObject("ENGL.Ztoolkit.Utils")
        Set ZENworks= CreateObject("ENGL.Ztoolkit.ZENworks")
        
        ' Set ZISD Version
        ZENworks.ZISDVersion = 11
        
        
        utils.appendlog "Authenticating to network share for log file copy"
        utils.run "%comspec% /c net use \\<server>\<share> /user:<username> <password> >> c:\ztoolkit\ztoolkit.log",0,true
        


      • If the logged in user credentials are to be used to authenticate to the network location then update the script below to include the network share details

        ' ENGL Imaging Toolkit
        ' Copyright (C) 1999-2017 Expert Networking Group Limited
        
        ' Custom script template (phase4-before.vbs)
        
        ' Attach to ENGL Ztoolkit ActiveX Control
        Set LDAP= CreateObject("ENGL.Ztoolkit.LDAP")
        Set Utils= CreateObject("ENGL.Ztoolkit.Utils")
        Set ZENworks= CreateObject("ENGL.Ztoolkit.ZENworks")
        
        ' Set ZISD Version
        ZENworks.ZISDVersion = 11
        
        
        utils.appendlog "Authenticating to network share for log file copy"
        utils.run "%comspec% /c net use \\<server>\<share> >> c:\ztoolkit\ztoolkit.log",0,true
        


    • Save the changes to the phase4-before.vbs script

    • Run the Deployment Wizard then recreate the build process image (ztoolkit.zmg)

    • Copy the updated ztoolkit.zmg file to the appropriate location on the imaging server

  2. Test

    • Test the updated build process to confirm it is completing and that the log file is now copying successfully at the end of phase 4.