How To:
In this scenario, we have several NEW machines including different models to be provisioned and we need to deploy a different image according to the model. This scenario will show us how to collect the model of the computer in the registry within WinPE environment which will be reported back to the Core Server in the temporary inventory of this machine.
We will then use this value in the inventory to create some conditions in the provisioning template to deploy 1 image or another based on this value.
Step by Step:
Step 1: Create a batch file with the following code
FOR /F "tokens=3*" %%a IN ('reg query "HKLM\HARDWARE\DESCRIPTION\SYstem\BIOS" /V SystemProductName 2^>nul') do miniscan.exe /send="Custom Data - Model = %%a %%b"
NOTE: This code is designed to collect the device model name from a registry key, and then use miniscan.exe available in WinPE to report a custom data back to the Core Server to be available on the inventory of the device being provisioned.
Step 2: Save this batch file onto a share folder
NOTE: I called it "\\<CORESERVER>\TEST_SOFTWARE\SystemProductName.bat"
Step 3: Go on your provisioning template and go in "OS Installation section"
a. Add a first action "Download Preferred Server" to download the batch file created in Step 1 into WinPE.
NOTE: Do not forget to specify the Read credentials for the corresponding Preferred server (In my example, I defined a preferred server called "10.1.1.210")
b. Add a second action "Execute File" to execute the batch file
c. Now the value appears in the inventory of the new device:
d. We can use an "if conditional" action to deploy one or another image depending on this inventory data:
NOTE: see How to use Conditionals in LANDESK 2016 Provisioning to know how to use the conditionals (In this article, it actually explains how to deploy an image based on an inventory value, but for a computer which was already existing on the Core Server, hence the inventory data were already there).