Scenario
This TID details a scenario where a company has sites in 3 different countries and wants to use a single Imaging Toolkit project to maintain consistency.
In this example each site is on a different subnet and has a different PXE enabled Distribution Point at each site. The company wishes to set the following settings dynamically based on the location of the machine being deployed:
- Timezone
- Locale (language settings)
- Active Directory OU
In addition, this TID also covers adding the device to a Site Specific Collection within SCCM.
By using this TID as a guideline it should be straightforward to modify the scenario to meet your own specific requirements.
Requirements
- ENGL deployment process configured and working using System Center Configuration Management
- Access to the System Center console
- Text editor
Procedure
|
-
Create site lookup file
Create a site lookup file called
sites.ini
in theSMSTemp\zimfiles
folder on the SCCM server.NOTE: The zimfiles folder
will be found atc:\RemoteInstall\SMSTemp\zimfiles
if System Center was installed to the c:\ drive. It can also be found at\\{sccmserver}\REMINST\SMSTemp\zimfiles
.
This file contains multiple sections. The first section is a list of the IP Addresses for the PXE enabled SCCM Distribution Points (PROXYADDR
values) and the sites where they are located. The remaining sections contain the information for the site name found in the first section.NOTE: PROXYADDR
is an environment variable set by the ENGL boot process. This will be set to the IP address of the PXE enabled SCCM Distribution Point used to PXE boot the ENGL PE environment.For example:
; ENGL Sites Lookup File (sites.ini) ; ; Format: ; ; [PROXYADDR] section ; <PXE enabled SCCM Distribution Point > = <Site Name> ; ; [<Site Name>] sections ; SITE = Active Directory OU ; TZ = Time zone ; SL = System / User locale ; IL = Input locale [PROXYADDR] 10.40.1.2 = New York 10.30.1.2 = Paris 10.20.0.3 = London [New York] SITE = New York TZ = Eastern Standard Time SL = en-US IL = 0409:00000409 [Paris] SITE = Paris TZ = Romance Standard Time SL = fr-FR IL = 040C:0000040C [London] SITE = London TZ = GMT Standard Time SL = en-UK IL = 0809:00000809
-
Modify Zim script (zim.cfg) to read site lookup file and store information to EBD
Update the
\SMSTemp\zimfiles\zim.cfg
file with the following changes:-
Identify the site using the PROXYADDR variable
Add an entry in the zim.cfg file after the network information has been identified as shown in green below:
; Get network info Network:Get,eth0,IPADDR,Network_IP Network:Get,eth0,NETMASK,Network_Mask Network:Get,eth0,HWADDR,Network_Mac ; Read in current location from sites.ini File:Ini,Get,"/zimbin/sites.ini","PROXYADDR","%PROXYADDR%",lookup_site
-
Update "Hardware Detected" form to include a site drop down list
The changes (shown in green ) below will add a list of the sites to the form. The list will default to the current site based on the
PROXYADDR
information above.; 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,"Site1",Label,"Site:" Form:Item,"Site2",ListBox_File,"%lookup_site%","/zimbin/sites.ini","PROXYADDR","=",2 Form:Item,"Item13",Label,"Auto Restart after imaging" Form:Item,"Item14",RadioButtons,"Yes","Yes,No" Form:Display,"Info"
-
Save selected site
When a form is submitted, variables are created and set to the values of each form item. See the Imaging Toolkit documentation for more information.
Create a new variable to hold the value of the selected site as shown below in green ;If:Var,_Form,EQ,"_Cancel" Menu:Return End: Set:Ask_COMPUTERNAME,"%_Info_item12%" Set:ask_site,%_Info_Site2% Set:AutoRestart,"%_Info_item14%"
-
Read in site-specific information
Now that the site has been identified Zim must be configured gather the site-specific information by adding the following lines:
;Read site lookup file (sites.ini) Set:SiteIniPath,"%_ZimDir%sites.ini" File:Ini,Get,"%SiteIniPath%","%ask_site%","SITE",lookup_SITE File:Ini,Get,"%SiteIniPath%","%ask_site%","TZ",lookup_TZ File:Ini,Get,"%SiteIniPath%","%ask_site%","SL",lookup_SL File:Ini,Get,"%SiteIniPath%","%ask_site%","IL",lookup_IL
-
Update EBD
This information must now be stored to EBD so that it can be used during the Windows build process:
; Update EBDSTRING (sample) Set:EBDSTRING,PutKeyPairStringValue("%EBDSTRING%","Machine_Type","%Machine_Type%") Set:EBDSTRING,PutKeyPairStringValue("%EBDSTRING%","OS","%Project_OS%") Set:EBDSTRING,PutKeyPairStringValue("%EBDSTRING%","Project","%Lookup_Project%") ;Add site values to EBDSTRING string Set:EBDSTRING,PutKeyPairStringValue("%EBDSTRING%","SITE","%lookup_SITE%") Set:EBDSTRING,PutKeyPairStringValue("%EBDSTRING%","TZ","%lookup_TZ%") Set:EBDSTRING,PutKeyPairStringValue("%EBDSTRING%","SL","%lookup_SL%") Set:EBDSTRING,PutKeyPairStringValue("%EBDSTRING%","IL","%lookup_IL%")
Save the changes to thezim.cfg
file.
-
-
Modify Zimpeget.cmd to download the sites.ini file
zimpeget.cmd
in the SMSTemp\zimfiles directory (amongst other thngs) downloads the files necessary for the build process.- Edit zimpeget.cmd
- add
sites.ini
to the line that readsfor %%i in (engl.lic zim.cfg zim.jpg images.ini projects.ini) do Ztftpclient.exe /get /host:%PROXYADDR% /remote:"\SMSTemp\zimfiles\%%i" /local:%%i >NUL
so that it looks like this
for %%i in (engl.lic zim.cfg zim.jpg images.ini projects.ini sites.ini) do Ztftpclient.exe /get /host:%PROXYADDR% /remote:"\SMSTemp\zimfiles\%%i" /local:%%i >NUL
- Save the file
- add
- Edit zimpeget.cmd
-
Modify project settings to use variables
Nearly every setting in a project can be configured to use a variable. In this example the company wishes to control the localisation and registration settings using variables.
By default thephase0-before.vbs
script in a project will export all values stored in EBD as Windows environment variables with a prefix of "ENGL_" so it is a simple matter of modifying the project settings to use these values.
-
Configure localisation settings
- Launch Build Console
- Open the project
- Select the Expert View
- Select the Windows - Localisation section
- Set the appropriate Build Variables
- Save the changes to the project
- Launch Build Console
-
Active Directory join to a specific OU
- Launch Build Console
- Open the project
- Select the Expert View
- Select the Windows - Active Directory / Workgroup section
- Update the OU entry to use the appropriate variable(s)
- Save the changes to the project
- Launch Build Console
-
Configure localisation settings
-
Adding a device to a Site Specific Collection
- Identify the Site Specific Collection ID
- Launch the System Center Console
- Navigate to \Assets and Compliance\Overview\Device Collections
- Right click on the Site Specific Collection the select Properties
- Select the General tab then make a note of the Collection ID (eg LAB0000E)
- Launch the System Center Console
- Amend custom script in Build Console
- Launch Build Console
- Open the SCCM project that is to be deployed
- Select
Expert View
- Select Customisation > Custom Files
- Update
phase2-after.vbs
- Right click on
phase2-after.vbs
- Add the lines show in green
' Attach to ENGL Ztoolkit ActiveX Control Set LDAP = CreateObject("ENGL.Ztoolkit.LDAP") Set Utils = CreateObject("ENGL.Ztoolkit.Utils") Set EBD = CreateObject("ENGL.Ztoolkit.EBD") Set SCCM = CreateObject("ENGL.Ztoolkit.SCCM") ' Add custom script here... utils.appendlog "Add machine to London/LAB0000E collection" Status = SCCM.AddToCollection("LAB0000E") utils.appendlog "Status of SCCM.AddToCollection('LAB0000E') : " & status
NOTE: Replace LAB0000E with the Site Specific collection ID identified earlier
- Right click on
- Launch Build Console
- Identify the Site Specific Collection ID
-
Create and deploy new Ztoolkit image
- Launch Build Console
- Open the project
- Run the Deployment Wizard
- Select the option to create Build Process images
- Select the option to create the Build Process (ztoolkit) image
- Once complete copy the new Ztoolkit image to the server
- Launch Build Console
-
Test
Both Zim and the project have now been configured to identify and use site-specific information.
To test everything is working do the following:- PXE boot a machine into Zim
- Select the Restore menu
- Select the project
- When prompted confirm the computer name and note that the current site has automatically been selected
- Continue to restore all images and allow the machine to build
- Once the machine has built successfully log in and confirm the site-specific settings have been applied successfully
- PXE boot a machine into Zim
- If there are issues with the process review both the zim.log and ztoolkit.log to see where / what has failed to happen.
For more information about the log files review ENGL TID-2013016
If you have any problems or questions about the steps in this TID please contact the ENGL support team