Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jamie Glendinning ENGL Imaging Toolkit™ 6 Advanced ZENworks imaging integration and scripting.

Similar presentations


Presentation on theme: "Jamie Glendinning ENGL Imaging Toolkit™ 6 Advanced ZENworks imaging integration and scripting."— Presentation transcript:

1 Jamie Glendinning ENGL Imaging Toolkit™ 6 Advanced ZENworks imaging integration and scripting

2 Copyright © Expert Networking Group Limited 2 Agenda Introduction Zim Scenarios Capture img error codes to zim.log file Changing image restore locations Password protect dynamic Zim restore menu Dynamic development menu How to use VMware snapshots with Zim Selecting owner of machine from AD using search filters

3 Copyright © Expert Networking Group Limited 3 Introduction

4 Copyright © Expert Networking Group Limited 4 Introduction Level  Intermediate Duration  30 minutes Assumptions  An understanding of the ENGL build process

5 Copyright © Expert Networking Group Limited 5 Zim

6 Copyright © Expert Networking Group Limited 6 Zim What is Zim?  Zim is a front end to the ZENworks imaging environment  Zim is designed to simplify, secure and automate ZENworks imaging tasks.  Using Zim, imaging tasks can be delivered based on user credentials from the corporate LDAP directory.  These tasks can automate complex naming, partition and imaging tasks whilst the user is presented with a simple set of menu options.

7 Copyright © Expert Networking Group Limited 7 Zim zim.cfg The zim.cfg file that is created by the Imaging Toolkit 6 Build Console / Integration Wizard and will cover most basic customer requirements: Multiple projects Different OS’s Same OS – different build configurations Computer naming prompt Restore appropriate image files Restore appropriate driver image based on OS and Hardware filters

8 Copyright © Expert Networking Group Limited 8 Zim zim.cfg The zim.cfg file is a script file. It can be customised to meet the requirements of individual customers. The functions used to develop and extend the zim.cfg file can be found on the ENGL website:

9 Copyright © Expert Networking Group Limited 9 Scenario Capture img error codes to zim.log file

10 Copyright © Expert Networking Group Limited 10 Scenario Capture img error codes to zim.log file Zim will record img error codes to the zim.log file (if it is configured) however an error code does not always help if it is unclear what the error code number means. With ZCM 10.3.x and newer it is possible to review the imglogr file in the imaging environment to identify what img believes the issue is. Each time img is launched the imglogr file gets overwritten.

11 Copyright © Expert Networking Group Limited 11 Scenario Capture img error codes to zim.log file To record this information configure Zim to append to the zim.log file. To do this update the zim.cfg file with the following: File:Run,"cat imglogr >> /zimbin/zim.log",verbose after each img command you want to capture the error information on.

12 Copyright © Expert Networking Group Limited 12 Scenario Capture img error codes to zim.log file Dialog:Popup,"Restoring ENGL Smart Windows build process, please wait...",green Pause:3 File:Run,"img %imgrestorecmd%project_image_path%/%base_image%",verbose File:Run,"cat imglogr >> /zimbin/zim.log",verbose File:Run,"img %imgrestorecmd%project_image_path%/hotfixes.zmg",verbose File:Run,"cat imglogr >> /zimbin/zim.log",verbose If:Var,machine_type,eq,"tablet" File:Run,"img %imgrestorecmd%project_image_path%/tablet.zmg",verbose File:Run,"cat imglogr >> /zimbin/zim.log",verbose End: File:Run,"img %imgrestorecmd%project_image_path%/%project_novcomp%",verbose File:Run,"cat imglogr >> /zimbin/zim.log",verbose File:Run,"img %imgrestorecmd%project_image_path%/%project_ztoolkit%",verbose File:Run,"cat imglogr >> /zimbin/zim.log",verbose File:Run,"img %imgrestorecmd%project_image_path%/%drivers_image%",verbose File:Run,"cat imglogr >> /zimbin/zim.log",verbose Pause:2 Dialog:Popupclose Update the zim.cfg file so the new command is after each img command you want to capture the error information on.

13 Copyright © Expert Networking Group Limited 13 Scenario Capture img error codes to zim.log file [15-Apr-11 12:43:32] [Zim] [Debug] > SET [_error] to [0] [15-Apr-11 12:43:32] [Zim] [Debug] [File:Run,"img %imgrestorecmd%project_image_path%/%project_ztoolkit%","verbose"] [15-Apr-11 12:43:32] [Zim] [Debug] +[File:Run,"img -r -p 5173-xpsp3/ztoolkit.zmg","verbose"] [15-Apr-11 12:43:40] [Zim] [Debug] nCode = 1 [15-Apr-11 12:43:40] [Zim] [Debug] > SET [_error] to [1] [15-Apr-11 12:43:40] [Zim] [Debug] [File:Run,"cat imglogr >> /zimbin/zim.log","verbose"] Novell ZENworks Imaging Engine v (c) Copyright , Novell, Inc. All rights reserved. Image restored: 5173-xpsp3/ztoolkit.zmg from Elapsed time: 00:06 New image successful [15-Apr-11 12:43:40] [Zim] [Debug] nCode = 0 Sample zim.log file

14 Copyright © Expert Networking Group Limited 14 Scenario Changing image restore locations

15 Copyright © Expert Networking Group Limited 15 Scenario Changing image restore locations When restoring projects all image files are expected to be found in the../content-repo/images/ folder structure. This is very easy to manage however if there is more than one project with the same OS there can be a lot of duplicated files within the project structures.

16 Copyright © Expert Networking Group Limited 16 Scenario Changing image restore locations It is possible to modify the image restore folder structure so OS specific files are separate from project files and update Zim so that it knows where to restore files from.

17 Copyright © Expert Networking Group Limited 17 Scenario Changing image restore locations Dialog:Popup,"Restoring ENGL Smart Windows build process, please wait...",green Pause:3 File:Run,"img %imgrestorecmd%project_image_path%/%base_image%",verbose File:Run,"img %imgrestorecmd%project_image_path%/hotfixes.zmg",verbose If:Var,machine_type,eq,"tablet" File:Run,"img %imgrestorecmd%project_image_path%/tablet.zmg",verbose End: File:Run,"img %imgrestorecmd%project_image_path%/%project_novcomp%",verbose File:Run,"img %imgrestorecmd%project_image_path%/%project_ztoolkit%",verbose File:Run,"img %imgrestorecmd%project_image_path%/%drivers_image%",verbose Pause:2 Dialog:Popupclose Update the zim.cfg file to change the restore paths for the base image and drivers image Dialog:Popup,"Restoring ENGL Smart Windows build process, please wait...",green Pause:3 File:Run,"img %imgrestorecmd%os/%project_os%/%base_image%",verbose File:Run,"img %imgrestorecmd%project_image_path%/hotfixes.zmg",verbose If:Var,machine_type,eq,"tablet" File:Run,"img %imgrestorecmd%project_image_path%/tablet.zmg",verbose End: File:Run,"img %imgrestorecmd%project_image_path%/%project_novcomp%",verbose File:Run,"img %imgrestorecmd%project_image_path%/%project_ztoolkit%",verbose File:Run,"img %imgrestorecmd%os/%project_os%/%drivers_image%",verbose Pause:2 Dialog:Popupclose

18 Copyright © Expert Networking Group Limited 18 Scenario Changing image restore locations Move the base image files, driver images and HAL image files into the appropriate OS/ folders

19 Copyright © Expert Networking Group Limited 19 Scenario Password protect dynamic Zim restore menu

20 Copyright © Expert Networking Group Limited 20 Scenario Password protect dynamic Zim restore menu When configuring a standard menu item within Zim it is possible to specify a simple password to protect this menu item. It is not possible to specify a simple password with the dynamic menu items that are created based on the projects.ini file. It is possible to modify the zim.cfg file to prompt for the appropriate password once the dynamic menu item has been selected. The password is stored in an additional field in the projects.ini file

21 Copyright © Expert Networking Group Limited 21 Scenario Password protect dynamic Zim restore menu Update the zim.cfg file with the following information: Set:lookup_project,%_project_item2 Label:lookup_project_info ; Validate password if set in projects.ini file Set:pw_login_count,"0" Set:pw_login_count_max,"2" File:Ini,Get,"/zimbin/projects.ini","%lookup_project%","project_password",project_password label:validate_password If:var,project_password,ne,"" ; password has been set ; Display password prompt Dialog:InputPass,"Enter password:",prompt_password,RED if:var,prompt_password,ne,"%project_password%" Set:pw_login_count,math(+, 1) If:Var,pw_login_count,gt,"%pw_LOGIN_COUNT_MAX%" Dialog:Ask,"Menu Lockout!","You have failed to authenticate 3 times.\n \nPress a key to return to the main menu.","_Ok","red" menu:return End: goto:validate_password End: ; Read in project specific information File:Ini,Get,"/zimbin/projects.ini","%lookup_project%","project_image_path",project_image_path File:Ini,Get,"/zimbin/projects.ini","%lookup_project%","project_os",project_os File:Ini,Get,"/zimbin/projects.ini","%lookup_project%","base_image",base_image File:Ini,Get,"/zimbin/projects.ini","%lookup_project%","ztoolkit",project_ztoolkit File:Ini,Get,"/zimbin/projects.ini","%lookup_project%","novcomp",project_novcomp

22 Copyright © Expert Networking Group Limited 22 Scenario Password protect dynamic Zim restore menu Update the projects.ini file with the following “project_password = value”: ; ; ENGL Zim projects.ini lookup file ; [projects] project1 = Techbite drivers demo - Win 7 project2 = Windows 7 Enterprise (x86) - en-US project3 = xpsp3-test ; Project details [Techbite drivers demo - Win 7] Description = Techbite drivers demo - Win 7 project_image_path = techbite-drivers-win7 project_os = win7-ent-x86 base_image = win7-ent-x86-postsp ztoolkit = ztoolkit.zmg novcomp = project_password = [Windows 7 Enterprise (x86) - en-US] Description = Windows 7 Enterprise (x86) - en-US project_image_path = win7-demo project_os = win7-ent-x86 base_image = win7-ent-x86-postsp ztoolkit = ztoolkit.zmg novcomp = novcomp.zmg project_password = [xpsp3-test] Description = xpsp3-test project_image_path = xpsp3-test project_os = winxp-x86 base_image = winxp-x86-postsp ztoolkit = ztoolkit.zmg novcomp = novcomp.zmg project_password =

23 Copyright © Expert Networking Group Limited 23 Scenario Password protect dynamic Zim restore menu Note: The project_password attribute needs to be set on each project section. Zim will error if it is not available. The password does not need to be populated on each entry.

24 Copyright © Expert Networking Group Limited 24 Scenario Password protect dynamic Zim restore menu ProjectPassword Techbite drivers demo - Win Windows 7 Enterprise (x86) - xpsp3-test

25 Copyright © Expert Networking Group Limited 25 Demo Password protect dynamic Zim restore menu

26 Copyright © Expert Networking Group Limited 26 Scenario Password protect dynamic Zim restore menu

27 Copyright © Expert Networking Group Limited 27 Scenario Dynamic development menu

28 Copyright © Expert Networking Group Limited 28 Scenario Dynamic development menu Zim uses the projects.ini file to populate a dynamic restore menu When testing a project it is not always appropriate for the project to be available in this restore menu It is possible to modify the projects.ini file and the Development menu configuration in the zim.cfg file to separate test and live project restore options

29 Copyright © Expert Networking Group Limited 29 Scenario Dynamic development menu Update the projects.ini file with the following information: ; ; ENGL Zim projects.ini lookup file ; [projects] project1 = Techbite drivers demo - Win 7 project2 = Windows 7 Enterprise (x86) - en-US project3 = xpsp3-test ; Project details [Techbite drivers demo - Win 7] Description = Techbite drivers demo - Win 7 project_image_path = techbite-drivers-win7 project_os = win7-ent-x86 base_image = win7-ent-x86-postsp ztoolkit = ztoolkit.zmg novcomp = [Windows 7 Enterprise (x86) - en-US] Description = Windows 7 Enterprise (x86) - en-US project_image_path = win7-demo project_os = win7-ent-x86 base_image = win7-ent-x86-postsp ztoolkit = ztoolkit.zmg novcomp = novcomp.zmg [xpsp3-test] Description = xpsp3-test project_image_path = xpsp3-test1 project_os = winxp-x86 base_image = winxp-x86-postsp ztoolkit = ztoolkit.zmg novcomp = novcomp.zmg ; ; ENGL Zim projects.ini lookup file ; [projects] project1 = Techbite drivers demo - Win 7 project2 = Windows 7 Enterprise (x86) - en-US [Development] project1 = xpsp3-test ; Project details [Techbite drivers demo - Win 7] Description = Techbite drivers demo - Win 7 project_image_path = techbite-drivers-win7 project_os = win7-ent-x86 base_image = win7-ent-x86-postsp ztoolkit = ztoolkit.zmg novcomp = [Windows 7 Enterprise (x86) - en-US] Description = Windows 7 Enterprise (x86) - en-US project_image_path = win7-demo project_os = win7-ent-x86 base_image = win7-ent-x86-postsp ztoolkit = ztoolkit.zmg novcomp = novcomp.zmg [xpsp3-test] Description = xpsp3-test project_image_path = xpsp3-test1 project_os = winxp-x86 base_image = winxp-x86-postsp ztoolkit = ztoolkit.zmg novcomp = novcomp.zmg

30 Copyright © Expert Networking Group Limited 30 Scenario Dynamic development menu Update the zim.cfg file with the following information: ; Development Menu Menu:Start,mnu_dev,"Development Menu","Red" Menu:Item,dev_make_image,"Make an image" Menu:Item,dev_restore_image,"Restore an image" Menu:Separator Menu:Item,_previous,"Return to Maintenance Menu" Menu:Item,_top,"Return to Main Menu" ; Development Menu Menu:Start,mnu_dev,"Development Menu","Red" ; Enable variable expansion in menu, item title and item params and before adding menu item Set:_MenuExpandTitleVariables,"true" Set:_MenuExpandItemParamsVariables,"true" ; Get first project section name Set:devIndex,1 Set:devKey,“project%devIndex%“ File:Ini,Get,"projects.ini","Development","%devKey%",devSection While:Var,devSection,ne,"“ ; Get project details File:Ini,Get,"projects.ini","%devSection%","Description",devDescription ; Add menu item Menu:Item,restore_ztoolkit_begin,"%devDescription%","","%devDescription%“ ; Next project section Set:devIndex,Math("+", 1) Set:devKey,"dev%devIndex%“ File:Ini,Get,"projects.ini","Development","%devKey%",devSection Wend: ; Disable variable expansion in menu, item title and item params and after adding menu item Set:_MenuExpandTitleVariables,"false" Set:_MenuExpandItemParamsVariables,"false“ Menu:Separator Menu:Item,dev_make_image,"Make an image" Menu:Item,dev_restore_image,"Restore an image" Menu:Separator Menu:Item,_previous,"Return to Maintenance Menu" Menu:Item,_top,"Return to Main Menu"

31 Copyright © Expert Networking Group Limited 31 Demo Standard development menu

32 Copyright © Expert Networking Group Limited 32 Scenario Dynamic development menu

33 Copyright © Expert Networking Group Limited 33 Demo Dynamic development menu

34 Copyright © Expert Networking Group Limited 34 Scenario Dynamic development menu

35 Copyright © Expert Networking Group Limited 35 Scenario How to use VMware snapshots with Zim

36 Copyright © Expert Networking Group Limited 36 Scenario How to use VMware snapshots with Zim When testing in a VMware environment it is more efficient to revert to a snapshot of a base image than restore the entire image from the ZENworks imaging server. Zim can be configured to bypass restoration of the base image if the client machine is running within a virtual machine.

37 Copyright © Expert Networking Group Limited 37 Scenario How to use VMware snapshots with Zim To configure the virtual machine PXE boot to Zim menu Select Maintenance Menu Select Development Menu Select Restore an image Select from list Enter base image name and restore it Shut down machine Make a VMware snapshot of machine

38 Copyright © Expert Networking Group Limited 38 Scenario How to use VMware snapshots with Zim Update the zim.cfg file with the following information: Form:Display,"Info" If:Var,_Form,Eq,"_Cancel" Menu:Return End: Set:Ask_COMPUTERNAME,%_Info_item7% Set:AutoRestart,%_Info_item9% 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 \nContinue?","_YesNo",red If:Var,_ask,eq,"_No" Menu:Return End: Dialog:Popup,"Restoring ENGL Smart Windows build process, please wait...",green Pause:3 File:Run,"img %imgrestorecmd%project_image_path%/%base_image%",verbose File:Run,"img %imgrestorecmd%project_image_path%/hotfixes.zmg",verbose Form:Display,"Info" If:Var,_Form,Eq,"_Cancel" Menu:Return End: Set:Ask_COMPUTERNAME,%_Info_item7% Set:AutoRestart,%_Info_item9% If:Var,Ask_COMPUTERNAME,ne,"%COMPUTERNAME%" Set:COMPUTERNAME,"%Ask_COMPUTERNAME%" End: ; If machine is a VMWare machine - prompt for base image to restore (allows for snapshot workaround) If:Var,lookup_section,contains,"vmw" ; Launch a Form to display detected hardware and select machine type Form:Start,"vmware","Select Base image to use","_OkCancel^Ok” Form:Item,"Item1",StaticText,"VMWare Machine detected" Form:Item,"Item2",Label,"Select Base Image type :" Form:Item,"Item3",RadioButtons,"","Restore Image, Snapshot" Form:Display,"vmware" If:Var,_Form,Eq,"_Cancel" Menu:Return End: If:var,_vmware_item3,eq,"Snapshot" set:base_image,"" End: Dialog:Ask,"", "Warning! All hard disk data on this machine will be erased.\n \nContinue?","_YesNo",red If:Var,_ask,eq,"_No" Menu:Return End: Dialog:Popup,"Restoring ENGL Smart Windows build process, please wait...",green Pause:3 File:Run,"img %imgrestorecmd%project_image_path%/%base_image%",verbose File:Run,"img %imgrestorecmd%project_image_path%/hotfixes.zmg",verbose

39 Copyright © Expert Networking Group Limited 39 Demo How to use VMware snapshots with Zim

40 Copyright © Expert Networking Group Limited 40 Scenario How to use VMware snapshots with Zim

41 Copyright © Expert Networking Group Limited 41 Scenario How to use VMware snapshots with Zim

42 Copyright © Expert Networking Group Limited 42 Scenario Selecting owner of machine from AD using search filters

43 Copyright © Expert Networking Group Limited 43 Scenario Selecting owner of machine from AD using search filters It is sometimes useful to identify the owner of a machine at imaging in order to fully customise the machine for that user account. The easiest way to do this is to configure an LDAP query in a Zim form. This will present the user with a list of user accounts, one of which can be selected and the appropriate information stored to ZISD

44 Copyright © Expert Networking Group Limited 44 Scenario Selecting owner of machine from AD using search filters Modify the standard zim.cfg file ; Authenticate to LDAP server LDAP:Init,"labsrv.engllab.local",389 If:Var,_error,eq,1 Dialog:Ask,"LDAP Bind Error","%_ldaperrorstr%","_any",RED LDAP:Unbind Goto:TheEnd End: ; Launch a Form to display detected hardware and select machine type Form:Start,"Info","Hardware Detected","_OkCancel^_Ok",Blue Form:Item,"Item1",StaticText,"-Manufacturer : %lookup_section%" Form:Item,"Item2",StaticText,"-Model : %lookup_value%" Form:Item,"Item3",StaticText,"-Hardware Image : %drivers_image%" Form:Item,"Item4",StaticText,"-Hardware Type : %machine_type%" Form:Item,"Item5",StaticText,"-OS : %project_os%" Form:Item,"Item6",Label,"Computer Name :" Form:Item,"Item7",EditBox,"%COMPUTERNAME%" Form:Item,"Item8",Label,"Select Owner :" Form:Item,"item9",ListBox_LDAP,"","OU=users,OU=itz6,DC=engllab,DC=local",ONELEVEL,"(objectclass=Person)","cn" Form:Item,"Item10",Label,"Auto Restart after imaging:" Form:Item,"Item11",Radiobuttons,"Yes","Yes,No" Form:Display,"Info" If:Var,_Form,Eq,"_Cancel" Menu:Return End: Set:Ask_COMPUTERNAME,%_Info_item7% Set:ask_owner,%_Info_item9% Set:AutoRestart,%_Info_item11% If:Var,Ask_COMPUTERNAME,ne,"%COMPUTERNAME%" Set:COMPUTERNAME,"%Ask_COMPUTERNAME%" End:

45 Copyright © Expert Networking Group Limited 45 Scenario Selecting owner of machine from AD using search filters ; Update the information in ZISD Zisd:Put,NetBiosName,%COMPUTERNAME% ; Update VendorDataENGL Set:VendorDataENGLSTRING,PutKeyPairStringValue("%VendorDataENGLSTRING%","Machine_Type","%machine_type%") Set:VendorDataENGLSTRING,PutKeyPairStringValue("%VendorDataENGLSTRING%","OS","%project_os%") Set:VendorDataENGLSTRING,PutKeyPairStringValue("%VendorDataENGLSTRING%","Project","%lookup_project%") Set:VendorDataENGLSTRING,PutKeyPairStringValue("%VendorDataENGLSTRING%","Owner","%ask_owner%") ZISD:Put,VendorDataENGL,"%VendorDataENGLSTRING%" Zisd:Write

46 Copyright © Expert Networking Group Limited 46 Scenario Selecting owner of machine from AD using search filters

47 Copyright © Expert Networking Group Limited 47 Scenario Selecting owner of machine from AD using search filters This method is very useful as a starting point to querying AD but has some limitations:  AD by default limits LDAP queries to 1000 results  Need to scroll through each item to find the appropriate username It is possible to extend the form to prompt for an attribute of the user account then use this attribute to filter the list of users:  First name  Surname

48 Copyright © Expert Networking Group Limited 48 Scenario Selecting owner of machine from AD using search filters By filtering the query on an attribute the number of results is normally well within the 1000 record limit for AD LDAP queries and will result in a much shorter list to scroll through to select the appropriate user.

49 Copyright © Expert Networking Group Limited 49 Scenario Selecting owner of machine from AD using search filters Modify the standard zim.cfg file ; Read zisd:VendorDataENGL zisd:get,VendorDataENGL,VendorDataENGLSTRING ; Read stored information in from VendorDataENGL Set:zisd_project,GetKeyPairStringValue("%VendorDataENGLSTRING%", "project") Set:zisd_owner,GetKeyPairStringValue("%VendorDataENGLSTRING%", “Owner") Set:zisd_owner_firstname,GetKeyPairStringValue("%VendorDataENGLSTRING%", “Owner_firstname") Set:zisd_owner_surname,GetKeyPairStringValue("%VendorDataENGLSTRING%", “Owner_surname") This reads in ZISD:VendorDataENGL and sets additional variables based on the info (if it exists) that is stored in the Owner key pair strings

50 Copyright © Expert Networking Group Limited 50 Scenario Selecting owner of machine from AD using search filters Add LDAP authentication Label:ztoolkit_computername ; Check for an AssetTag we can use for the DMI_NAME Set:DMI_NAME,"" If:Var,dmi_board_asset,ne,"" Set:DMI_NAME,"%dmi_board_asset%" ElseIf:Var,dmi_chassis_asset,ne,"" Set:DMI_NAME,"%dmi_chassis_asset%" End: Set:COMPUTERNAME,"" ; Read the Computername in from ZISD (if it exists) Zisd:Get,NetBiosName,ZISD_COMPUTERNAME If:Var,ZISD_COMPUTERNAME,ne,"" Set:COMPUTERNAME,%ZISD_COMPUTERNAME% Else: Set:COMPUTERNAME,"%DMI_NAME%" End: Label:ztoolkit_computername ; Check for an AssetTag we can use for the DMI_NAME Set:DMI_NAME,"" If:Var,dmi_board_asset,ne,"" Set:DMI_NAME,"%dmi_board_asset%" ElseIf:Var,dmi_chassis_asset,ne,"" Set:DMI_NAME,"%dmi_chassis_asset%" End: Set:COMPUTERNAME,"" ; Read the Computername in from ZISD (if it exists) Zisd:Get,NetBiosName,ZISD_COMPUTERNAME If:Var,ZISD_COMPUTERNAME,ne,"" Set:COMPUTERNAME,%ZISD_COMPUTERNAME% Else: Set:COMPUTERNAME,"%DMI_NAME%" End: ; Authenticate to LDAP server LDAP:Init,"labsrv.engllab.local",389 If:Var,_error,eq,1 Dialog:Ask,"LDAP Bind Error","%_ldaperrorstr%","_any",RED LDAP:Unbind Menu:Return End:

51 Copyright © Expert Networking Group Limited 51 Scenario Selecting owner of machine from AD using search filters label:owner_form ; Launch a Form to prompt for machine Owner Form:Start,"Owner","User Details","_NextCancel^_Next",Blue Form:Item,"Item1",StaticText,"Enter Owner details" Form:Item,"Item2",Label,"Firstname :" Form:Item,"Item3",EditBox,"%zisd_owner_firstname%" Form:Item,"Item4",Label,"Surname :" Form:Item,"Item5",EditBox,"%zisd_owner_surname%" Form:Item,"Item6",StaticText,"-Minimum 1 character in each box" Form:Display,"Owner" If:Var,_Form,Eq,"_Cancel" Menu:Return End: Set:ask_owner_firstname,%_owner_item3% Set:ask_owner_surname,%_owner_item5% ; Validate Owner info (need minimum of 1 character required for filter to be valid) if:var,ask_owner_firstname,eq,"" set:owner_valid,False end: if:var,ask_owner_surname,eq,"" set:owner_valid,False end: if:var,owner_valid,eq,"False" dialog:banner,"invalid Owner information detected \n Please re-enter",1,red set:owner_valid,"" goto:owner_form end: Configure a Zim form to prompt for Owner information

52 Copyright © Expert Networking Group Limited 52 Scenario Selecting owner of machine from AD using search filters label:validate_form ; Launch a Form to display detected hardware and select machine type Form:Start,"validate","Confirm Owner","_BackNextCancel^_Next",Blue Form:Item,"Item1",Label,"Select Owner :" Form:Item,"item2",ListBox_LDAP,"","DC=engllab,DC=local",SUBTREE,"(&(objectclass=Person)(givenName=%ask_owner_firstname% *)(sn=%ask_owner_surname%*)(!(objectclass=computer)))","sAMAccountName" Form:Item,"Item3",Label,"Check Yes to lookup local user details if required:" Form:Item,"Item4",Radiobuttons,"No","Yes,No" Form:Display,"validate" If:Var,_Form,Eq,"_Cancel" Menu:Return End: If:Var,_Form,Eq,"_Back" Goto:owner_form End: Set:valid_owner,%_validate_item2% Set:valid_owner_dn,%_validate_item2_ldap_dn% Set:valid_check,%_validate_item4% if:var,valid_owner,eq,"" ; Owner validation has failed - need to re-input Owner information set:ask_owner_firstname,"" set:ask_owner_surname,"" dialog:banner,"Invalid Owner details detected \n Please re-enter",3,red Goto:owner_form end: ; Read in additional account attributes ; displayName LDAP:GetAttr,"%valid_owner_dn%","displayName",ldap_displayName ; userPrincipalName LDAP:GetAttr,"%valid_owner_dn%","userPrincipalName",ldap_userPrincipalName ; sAMAccountName LDAP:GetAttr,"%valid_owner_dn%","sAMAccountName",ldap_sAMAccountName ; givenName LDAP:GetAttr,"%valid_owner_dn%","givenName",ldap_givenName ; sn LDAP:GetAttr,"%valid_owner_dn%","sn",ldap_sn Validate Owner information and Display (if selected)

53 Copyright © Expert Networking Group Limited 53 Scenario Selecting owner of machine from AD using search filters If:var,valid_check,eq,"Yes“ ; Launch a Form to validate local user entered prieviously Form:Start,"accountcheck","Additional local user lookup","_BackNextCancel^_Next",Blue Form:Item,"Item1",StaticText,"-The local user has been entered as : %valid_owner%" Form:Item,"Item2",StaticText,"-Additional information" Form:Item,"Item4",StaticText,"-Full Name : %ldap_displayName%" Form:Item,"Item5",StaticText,"-First Name : %ldap_givenName%" Form:Item,"Item6",StaticText,"-Surname : %ldap_sn%" Form:Item,"Item7",StaticText,"-AD Name : %ldap_userPrincipalName%" Form:Item,"Item8",StaticText,"-Account name : %ldap_sAMAccountName%" Form:Item,"Item9",StaticText,"-Click on back twice to re-enter the local user information" form:display,"accountcheck" If:var,_Form,eq,"_cancel" Menu:Return End: If:var,_Form,eq,"_Back" goto:validate_form End: ; Launch a Form to display detected hardware and select machine type Form:Start,"info","Confirm information","_BackFinishCancel^_Finish",Blue Form:Item,"Item1",StaticText,"-Manufacturer : %lookup_section%" Form:Item,"Item2",StaticText,"-Model : %lookup_value%" Form:Item,"Item3",StaticText,"-Hardware Image : %drivers_image%" Form:Item,"Item4",StaticText,"-Hardware Type : %machine_type%" Form:Item,"Item5",StaticText,"-OS : %project_os%" Form:Item,"Item6",StaticText,"-Owner : %valid_owner%" Form:Item,"Item7",Label,"Computer Name :" Form:Item,"Item8",EditBox,"%COMPUTERNAME%" Form:Item,"Item9",Label,"Auto Restart after imaging:" Form:Item,"Item10",Radiobuttons,"Yes","Yes,No" form:display,"info" Set:Ask_COMPUTERNAME,%_Info_item8% Set:AutoRestart,%_Info_item10% If:Var,Ask_COMPUTERNAME,ne,"%COMPUTERNAME%" Set:COMPUTERNAME,"%Ask_COMPUTERNAME%" End: Display user and workstation details

54 Copyright © Expert Networking Group Limited 54 Scenario Selecting owner of machine from AD using search filters Dialog:Popup,"Restoring ENGL Smart Windows build process, please wait...",green Pause:3 File:Run,"img %imgrestorecmd%project_image_path%/%base_image%",verbose File:Run,"img %imgrestorecmd%project_image_path%/hotfixes.zmg",verbose If:Var,machine_type,eq,"tablet" File:Run,"img %imgrestorecmd%project_image_path%/tablet.zmg",verbose End: File:Run,"img %imgrestorecmd%project_image_path%/%project_novcomp%",verbose File:Run,"img %imgrestorecmd%project_image_path%/%project_ztoolkit%",verbose File:Run,"img %imgrestorecmd%project_image_path%/%drivers_image%",verbose Pause:2 Dialog:Popupclose ; Update the information in ZISD Zisd:Put,NetBiosName,%COMPUTERNAME% ; Update VendorDataENGL (sample) Set:VendorDataENGLSTRING,PutKeyPairStringValue("%VendorDataENGLSTRING%","Machine_Type","%machine_type%") Set:VendorDataENGLSTRING,PutKeyPairStringValue("%VendorDataENGLSTRING%","OS","%project_os%") Set:VendorDataENGLSTRING,PutKeyPairStringValue("%VendorDataENGLSTRING%","Project","%lookup_project%") Set:VendorDataENGLSTRING,PutKeyPairStringValue("%VendorDataENGLSTRING%","Owner","%valid_owner%") Set:VendorDataENGLSTRING,PutKeyPairStringValue("%VendorDataENGLSTRING%","Owner_surname","%ldap_sn%") Set:VendorDataENGLSTRING,PutKeyPairStringValue("%VendorDataENGLSTRING%","Owner_firstname","%ldap_givenName%") ZISD:Put,VendorDataENGL,"%VendorDataENGLSTRING%" Zisd:Write ; Trap ZISD:Write errors If:Var,_ERROR,ne,"0" Dialog:Ask,"Error!","An error occurred writing information to ZISD!","_Ok",red End: If:Var,AutoRestart,eq,"Yes" Goto:reboot End: Menu:Return Update information being written to ZISD

55 Copyright © Expert Networking Group Limited 55 Scenario Selecting owner of machine from AD using search filters Note: The information used to configure the LDAP filtering can be customised to filter on whichever attribute you need to use, for some scenarios the surname, sAMAccountName or Display Name may be more appropriate to use. If you require assistance in configuring forms to meet your needs contact us and we will be happy to assist.

56 Copyright © Expert Networking Group Limited 56 Demo Selecting owner of machine from AD using search filters

57 Copyright © Expert Networking Group Limited 57 Scenario Selecting owner of machine from AD using search filters

58 Copyright © Expert Networking Group Limited 58 Summary

59 Copyright © Expert Networking Group Limited 59 Summary The standard zim.cfg file can be modified and extended to ensure that Zim meets your requirements.

60 Copyright © Expert Networking Group Limited 60 Issues

61 Copyright © Expert Networking Group Limited 61 Issues If you would like any more information or assistance with the procedures detailed in this TechBite let us know! Log an incident on englnet https://englnet.engl.co.uk/nps Report an issue via support forum - engl.support.imagingtoolkit6.imaging

62 Copyright © Expert Networking Group Limited 62 More information

63 Copyright © Expert Networking Group Limited 63 More Information Useful links  Product information and Downloads  Success Stories  Partners

64 Copyright © Expert Networking Group Limited 64 More Information Future Events  Tech Bite sessions  Brainshare

65


Download ppt "Jamie Glendinning ENGL Imaging Toolkit™ 6 Advanced ZENworks imaging integration and scripting."

Similar presentations


Ads by Google