User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

I'm sure you have seen Steve Thompson's blog showing how ENGL Imaging Toolkit 10.0.2 can help tidy up the Windows Start Menu.

This blog will take the process a step further and show you how you can use PowerShell and Imaging Toolkit 10.0.2 to control what appears on the Windows 10 start menu.

Our scenario for this blog is that we want to select which apps are displayed on the start menu from the Zim menu at the point of imaging.


Identify Apps

First of all we need to know which applications are installed in our standard build, so from a machine built using an Imaging Toolkit proect, launch the powershell console then type:


The output displays the Start menu application name and it's corresponding appID, we only need the application name at this point so can run the command:

 Get-StartApps | Select-Object name


Select Apps in Zim

We can then select the applications that we might want to display on the Start menu and create a list which can be displayed on a Zim form.

There are several changes to the zim.cfg file required, these are highlighted in green below. A sample zim.cfg file is in the zip file attached at the bottom of the page for reference.

  1. Read in information stored in ZENworks Image-Safe Data (ZISD)
    ; Get network info 
    ; Read ZISD:VendorDataENGL 
    ; Read stored information in from VendorDataENGL 
    Set:Zisd_Project,GetKeyPairStringValue("%VendorDataENGLSTRING%", "Project") 
    ; *** Start Menu Blog *** 
    ; Read StartMenu Apps List in from ZISD 
    Set:Zisd_apps,GetKeyPairStringValue("%VendorDataENGLSTRING%", "Apps")
    ; *** Start Menu Blog ***
  2. Create a list of applications and modify the Zim form to display the list as a series of checkboxes
    ; *** Start Menu Blog *** 
    Set:Applist,"Mozilla Firefox,Mozilla Thunderbird,FileZilla,VLC media player,Skype,LibreOffice Calc,LibreOffice Math,LibreOffice Writer,GIMP 2,Google Earth,Notepad++,ZENworks Application Window,PDFCreator,PuTTY,WinSCP"" 
    ; *** Start Menu Blog *** 
    ; Launch a Form to display detected hardware and select machine type 
    Form:Start,"Info","Hardware Detected","_OkCancel^_Ok",Blue 
    Form:Item,"Item5",Label,"Hardware Image" 
    Form:Item,"Item7",Label,"Hardware Type" 
    Form:Item,"Item11",Label,"Computer Name" 
    ; *** Start Menu Blog *** 
    Form:Item,"apps1",Label,"Select Start Menu Apps" 
    ; *** Start Menu Blog *** 
    Form:Item,"Item13",Label,"Auto Restart after imaging" 
    ; *** Start Menu Blog *** 
    ; *** Start Menu Blog ***
  3. Store the list of selected applications to ZISD
     Dialog:Popup,"Restoring ENGL Smart Windows build process, please wait...",Green Pause:3
     ; Update VendorDataENGL (sample)
     ; *** Start Menu Blog *** 
     ; *** Start Menu Blog *** 

We can now display a form that lists the applications you would like to see on the start menu, the list will be stored in ZISD so that we can use it during the Imaging Toolkit build process.


Configuring the Start Menu

We now have a list of applications that we'd like to display, so the next step is to configure Windows 10 to display our applications rather than the default set.

Windows 10 includes several features that we will use:

  • Group Policy to control the Start menu
  • PowerShell Method to export the current Start menu layout
  • PowerShell Method to manipulate XML files

Imaging Toolkit 10.0.2 includes ZtoolkitCtrl PowerShell methods. These will be combined into a phase3-after.ps1 script that can be used during the build process.

Export the Current Start menu layout.

The Default Start menu will look like this:

The PowerShell function "Export-StartLayout" will export the current start menu layout.

Open the PowerShell Console then run:

 Export-StartLayout -Path "C:\engl\StartMenu.xml"

This will produce a StartMenu.XML file for the current layout:

We want to modify this layout to display the applications we have selected. The phase3-after.ps1 script included in the attached zip will perform the following tasks:

  1. Extract the list of applications we stored in ZISD
  2. Export the current Start menu layout toC:\ENGL\StartMenu.xml
  3. Create an 'ENGL APPS' group and populate that group with the list of applications read from ZISD
  4. Remove the two default Microsoft groups, this will remove Edge and Cortana from the Start menu.
  5. Save the modified StartMenu.xml file

The updated StartMenu.xml file will now contain our selected applications:

Using Group Policy to Control the start Menu.

Once we have the Start menu layout file we can use Windows 10 Group policy "Start Layout" optionto apply the layout. The policy setting can be delivered by a registry edit, ZENworks policy or AD Group Policy, in this case we will set the following registry key directly in the phase3-after.ps1 script


We will also lock the Start menu layout by setting the following value to 1:


Adding the script file to the Project

The phase3-after.ps1 script file will need to be added into our Windows 10 project.

  1. Open the project in Build Console
  2. Select Expert View
  3. Select Customisation > Custom Files
  4. Right click in the Properties box and select Add
  5. Browse to the phase3-after.ps1 file and click OK

The script file will now be included in the Build Process image and will run automatically at the end of phase3 of the deployment process.

Recreate the Build Process image (ztoolkit)

  1. Launch the Deployment Wizard
  2. Select the option to create Build Process images
  3. Select the option to create the Build Process (ztoolkit) image
  4. Once complete, copy the new Ztoolkit image to the server

Deploy the project to a Windows 10 Machine

Deploy the project to a suitable machine and make a note of the applications you select from the imaging menu:

Once the deployment process has completed, log in and review the Start menu.


Additional options

This blog covers one scenario and start menu layout. There are a number of options available to you for the menu layout such as making the Start menu full screen, changing the number of columns or the tile size, configuring multiple groups etc.


Files for download