Scenario
This TID details a scenario where a company has a requirement for different applications to be delivered and installed on different sites (as shown in the table below) using a single Imaging Toolkit project and a single build user.
By using Collection Variables it is possbilbe to tailor application delivery based on the location of the machine being deployed.
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
-
sites.ini
created using ENGL TID-2015014
Procedure
|
-
Identify the Site Collection IDs
- 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 London = LAB0000E)
- Repeat for each Site Collection
- Launch the System Center Console
-
Update site lookup file
Add your Site Collection IDs to your
sites.ini
shown in greenNOTE: The sites.ini
file was created using ENGL TID-2015014For example:
; ENGL Sites Lookup File (sites.ini) ; ; Format: ; ; [PROXYADDR] section ; <PXE Boot Server> = <Site Name> ; ; [<Site Name>] sections ; SITE = Active Directory OU ; TZ = Time zone ; SL = System / User locale ; IL = Input locale ; ID = Collection ID [PROXYADDR] 10.40.1.2 = New York 10.20.0.3 = London [New York] SITE = New York TZ = Eastern Standard Time SL = en-US IL = 0409:00000409 ID = LAB10014 [London] SITE = London TZ = GMT Standard Time SL = en-UK IL = 0809:00000809 ID = LAB0000E
-
Update zim.cfg to read and store the Site Specific collection ID to EBD
- Read in the Collection ID information by adding the following line shown in green
;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 File:Ini,Get,"%SiteIniPath%","%ask_site%","ID",lookup_ID
- Store the information to EBD (so that it can be used during the Windows build process) by adding in the following line shown in green
;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%") Set:EBDSTRING,PutKeyPairStringValue("%EBDSTRING%","ID","%lookup_ID%")
Save the changes to thezim.cfg
file.
- Read in the Collection ID information by adding the following line shown in green
-
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... CollectionID = utils.ExpandString("%ENGL_ID%") utils.appendlog "Add machine to " & CollectionID & " collection" Status = SCCM.AddToCollection(CollectionID) utils.appendlog "Status of SCCM.AddToCollection : " & status
- Right click on
- Launch Build Console
-
Edit Collection variable
- Launch the System Center Console
- Navigate to \Assets and Compliance\Overview\Device Collections
- Right click on the Site Specific Collection (eg ENGL London Site) the select Properties
- Select Collection Variable tab and create the following entry;
Name: ENGLAPPS01 Value: LibreOffice 5.0.2.2
NOTE: - Value name must be the actual application name as configured in the SCCM Console.
- If you want to add additional applications just continue with ENGLAPPS02, ENGLAPPS03 etc. Where possible do not break the number order.
- Launch the System Center Console
-
Repair gaps in Dynamic Variable List
When the Dynamic variable list has a gap in it (ENGLAPPS02, ENGLAPPS03, ENGLAPPS05) then the application installation will halt at the gap. Microsoft are aware of this problem and provide a script which takes the name of the Dynamic Variable List and repairs any gaps in the order. We have amended the script to allow it to log to the ztoolkit.log file.
- Download (and extract) the script attached to this TID
- Launch Build Console
- Open the SCCM project that is to be deployed
- Select
Expert View
- Select Customisation > Custom Files
- Right click in the Properties box and select
Add
- Navigate to
correct-BaseVars.ps1
and then clickOpen
- The script file will now appear in the Properties box
- Download (and extract) the script attached to this TID
-
Update ENGL Application Deployment Task Sequence
- Launch the System Center Console
- Navigate to \Software Library\Overview\Operating Systems\Task Sequenses
- Right click on ENGL Application Deployment and select Edit
- Add a Run Command Line step. This is required to run the correct-BaseVars.ps1 powershell script and needs to occur before the App installation step.
- Select Add -> General -> Run Command Line
- Select the Properties tab
- Update the Name to "Reorder Dynamic variable list"
- Update the Command line to
powershell.exe -ExecutionPolicy Bypass -File c:\ztoolkit\correct-BaseVars.ps1 ENGLAPPS 2
- Click Apply to save the changes to the current page in the Task Sequence
- Select Add -> General -> Run Command Line
- Select the Install Application step (Apps)
- Select Install applications according to dynamic variable list option
- Enter the Base variable name = ENGLAPPS
- Click Apply to save the changes to the current page in the Task Sequence
- Select Install applications according to dynamic variable list option
- Click OK to save the changes to the Task Sequence
- Launch the System Center Console
-
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 install applications accourding to dynamic variable list.
To test everything is working do the following:- PXE boot a machine into Zim
- Select the Restore menu
- Select the project
- Check 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 applications have been installed according to the site-specific requirements
- 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