Issue

ZENworks Third-party imaging (3PI) allows a WinPE Imaging Script bundle type to be used to perform assigned imaging work to a device. With Imaging Toolkit a WinPE Imaging Script bundle can be automatically retrieved by ZimLoader and executed. This TID details how to use automated ZENworks imaging with ENGL WinPE.


Requirements

  • Imaging Toolkit 14.0 (or later)
  • ENGL WinPE imaging is configured and working
  • Updated zim.cfg that does not require any user input


Solution

  • Enable the use of the WinPE Imaging Script bundle type.
  • Configure zim.cfg to perform automated imaging tasks when WinPE is in automatic mode.

    NOTE:The Imaging Toolkit 14.0.2 Integration Wizard will automatically configure the zim.cfg without the need for the manual steps in this TID. Steps 1 and 2 of the procedure below are required to configure the imaging bundle in ZCM.


Procedure

  1. Enable WinPE Imaging Script bundles (ZCM 23.3 or above)

    1. Within ZENworks Control Center navigate to Configuration > Device Management > System Variables
    2. Add a new variable named SKIP_WINPE with the value true, then click OK
    3. At the System Variables page, click OK to apply the changes.
  2. Create a WinPE Imaging Script bundle

    • Using ZENworks Control Center navigate to the Bundles page.
    • Select New > Bundle.
    • At the Select bundle type page select Preboot Bundle.
    • At the Select bundle category page select WinPE Imaging Script.
    • At the Define details page enter a bundle name.
    • At the WinPE Imaging Script page, select Script Type of Batch, then enter the following Script Text.
      REM Project description must exist in projects.ini.
      SET PROJECT=WIN11-22H2-ENT
    • Save and Publish the bundle.
  3. Update zimpeget.cmd to run the WinPE Imaging Script

    1. Locate the "Enable Windows Firewall" section and add the lines in green below it as follows. 
      REM Enable Windows Firewall
      wpeutil.exe EnableFirewall

      REM Run WinPE Scripted Imaging bundle script to set PROJECT variable

      if exist \zimbin\tpi.bat call \zimbin\tpi.bat 
  4. Update zim.cfg for automatic mode

    • Locate the "Read ZISD" section and add the lines in green below it as follows. 
      ; Read ZISD:VendorDataENGL 
      ZISD:Get,VendorDataENGL,VendorDataENGLSTRING

      ; Read ZISD and check if PE session is in Automatic mode

      ZISD:Get,WinPEMode,imaging_mode
       
    • The imaging_mode variable can then be used to skip sections of the zim.cfg that display menus or prompt for information. Locate the "Menu definitions" section and insert the lines in green above it as follows:
      If:Var,imaging_mode,EQ,"auto" 
      ; "auto" imaging mode detected
        ; Skip menus and go straight to image restore section.
      Goto:Restore_Ztoolkit_Begin
      End:

      ; ------------------------------------------------------
      ; Menu Definitions
      ; ------------------------------------------------------
    • Locate the "launch a form to select project to build" section and modify as follows to skip the project selection form:
      If:Var,imaging_mode,EQ,"auto" 
      ; "auto" imaging mode detected.

      If:Var,Project,NE,""
      Set:Lookup_Project,"%Project%"
      Else:
      ; Set Lookup_Project to project information stored in ZISD
          Set:Lookup_Project,"%Zisd_Project%"

      End:
      Else:
      ; Launch a Form to select Project to build
      Form:Start,"Project","Project selection","_OkCancel^_Ok",Blue
      Form:Item,"Item1",Label,"Select Project      :"
      Form:Item,"Item2",ListBox_File,"%Zisd_Project%","%_ZimDir%projects.ini",
      "projects","=",2
      Form:Display,"Project"

      If:Var,_Form,EQ,"_Cancel"
      Menu:Return
      End:

      Set:Lookup_Project,"%_Project_Item2%"
      End: 
    • Locate the "launch a form to display detected hardware" section and modify as follows to skip the hardware detected form and computer name logic, and to force the machine to restart:
      If:Var,imaging_mode,EQ,"auto" 
      ; "auto" imaging mode detected. 
      ; Skip Hardware Detected form. 
      Set:AutoRestart,"Yes" 
      Else:
      ; Launch a Form to display detected hardware and select machine type

      Form:Start,"Info","Hardware Detected","_OkCancel^_Ok",Blue  
      Form:Item,"Item1",Label,"Manufacturer" 
      Form:Item,"Item2",EditBox,"%Lookup_Section%",ReadOnly Form:Item,"Item3",Label,"Model" 
      Form:Item,"Item4",EditBox,"%Lookup_Value%",ReadOnly Form:Item,"Item5",Label,
      Hardware Image" Form:Item,"Item6",EditBox,"%Drivers_Image%",ReadOnly 
      Form:Item,"Item7",Label,"Hardware Type" 
      Form:Item,"Item8",EditBox,"%Machine_Type%",ReadOnly Form:Item,"Item9",Label,"OS" 
      Form:Item,"Item10",EditBox,"%Project_OS%",ReadOnly Form:Item,"Item11",Label,
      Computer Name" Form:Item,"Item12",EditBox,"%Ask_COMPUTERNAME%" 
      Form:Item,"Item13",Label,"Auto Restart after imaging" 
      Form:Item,"Item14",RadioButtons,"Yes","Yes,No" 
      Form:Display,"Info"

      If:Var,_Form,EQ,"_Cancel" 
      Menu:Return 
      End:

      Set:Ask_COMPUTERNAME,"%_Info_item12%" 
      Set:AutoRestart,"%_Info_item14%"

      If:Var,Ask_COMPUTERNAME,EQ,"" 
      Dialog:Ask,"","You must specify a Computer Name.","_Ok",Red 
      Goto:Ztoolkit_ComputerName 
      Else: 
      Set:ComputerNameLength,Len(%Ask_COMPUTERNAME%) 
      If:Var,ComputerNameLength,GT,"15" 
      Dialog:ask,"Error","You must specify a Computer Name less than 16
      characters","_ok",Red 
      Goto:Ztoolkit_ComputerName_Form 
      End: 
        End:

      If:Var,Ask_COMPUTERNAME,CONTAINS," " 
      Dialog:Ask,"","The Computer Name must not contain a space.","_Ok",Red 
      Goto:Ztoolkit_ComputerName_Form
      End:

        If:Var,Ask_COMPUTERNAME,NE,"%COMPUTERNAME%"  
      Set:COMPUTERNAME,"%Ask_COMPUTERNAME%" 
      End:

        Dialog:Ask,"","Warning! All hard disk data on this machine will be erased.\n\n
      Continue?","_YesNo^_Yes",Red 
      If:Var,_Ask,EQ,"_No"  
      Menu:Return 
      End:
      End:
  5. Assign the bundle to a device

    • Within ZENworks Control Center assign the scripted imaging bundle to a registered device.
    • Select the device and from the Action menu select Apply Assigned Imaging Bundle.

      Alternatively, configure imaging rules to select a bundle based on manufacturer and model information.
  6. Test automated deployment

    • Boot up the machine with the scripted imaging bundle assigned.
    • The workstation should automatically PXE boot and start the deployment process.

If you have any problems or questions about the steps in this TID please contact the ENGL support team