Modern Management and Provisioning Packages that can be Deployed at the HP Factory

IT Professionals, will have to have a good understanding on the topic of modern management and why they need to implement this solution in their environment today. They need to understand that the old ways of doing things is no longer the best solution now that the world has changed due to covid-19. Modern management using autopilot and Intune, is not only more efficient but solves many of the problems that we face due to covid-19. Before Covid hit, everyone deployed computers systems via SCCM, Altiris, Ivanti, or by using cloning machines. Companies would purchase computers and bring them into a central location. Then the systems would be wiped and reloaded with an OS and application stack. When that was complete the systems would then be deployed to some central locations. In today’s day and age delivery of systems can take up to 3 or 4 months, due to CPU shortages, glass shortages and IC chip shortages. If you're imaging via the older methods then getting systems to users can take 4-6 months and with product lifecycles being anywhere from 12-18 months, the time it takes to develop and test an image can take you half way through a product lifecycle.

Modern Management using Autopilot and Intune can now solve this problem of getting systems into the hands of users as fast as possible. If a company has an Azure active directory domain, then HP can register the system hashes at the factory, so that they are delivered directly to the users, and those users can boot up and login directly to their company network. If HP customers need help with creating and pre-provisioning systems with provisioning packages, we offer a solution. HP can pre-provision systems with up to 5 provisioning packages, and also offers a service to help create the provisioning packages for deployment.

If you decide to use HP services to install some provisioning packages at the factory then there are some things you should know and some rules to the road. When Creating a provisioning package there are 4 requirements  that need to be met in order to pass the HP factory validation process.

1# you’ll need to generate a package install log and save it in this location C:\system.sav\Logs\CSAuditmode HP engineers will review this log during lab testing before the package is released for manufacturing. If there’s more than one package then the log creation is required for each package to be installed.

#2 if you have a custom unattend.xml file, it needs to be included with the package and a task must be created to copy it to this location C:\Windows\Panther\Unattend\Unattend.xml, HP will sysprep with this custom file after the package install is complete. If a custom file is not provided, then HP will sysprep with the standard OOBE.

#3 You’ll need to add a task to your package which creates a registry key for notifying HP if you want your image to sysprep/Generalize or not after the package has been installed. The flag must be set in the following registry location. HKEY_LOCAL_MACHINE\SOFTWARE\InstalledProducts\ProvisioningPackage. Name = GeneralizePostInstall, Type= REG_SZ, Data Value= False/True, True=Generalize, False= No Generalize, No Flag= Generalize. 

#4 Add a final task at the very end of your PPKG install process, which creates a registry Key for notifying HP your PPKG install process has completed and it is now safe to sysprep the image and shutdown. If this key does not exist, the manufacturing process will timeout and fail.

If there’s more than one PPKG for the project, this key must be included as the last task of the last PPKG installed.

 

  • The flag must be in the following registry location:

HKEY_LOCAL_MACHINE\SOFTWARE\HP\InstalledProducts\ProvisioningPackage

Name = PPKG

Type = REG_SZ

Data Value = installed

Command:

reg add HKEY_LOCAL_MACHINE\SOFTWARE\HP\InstalledProducts\ProvisioningPackage\ /v "PPKG" /t REG_SZ /d "Installed" /f

 

Testing to get through the validation process, the package install and sysprep must not exceed 30 minutes to complete. You should verify the image boots and all the packages succeeded. Verify the package install log was created here C:\system.sav\Logs\CSAuditmode and verify the package created a sysprep/Generalize registry key.

 

When using Windows Configuration Designer to create your packages you can script all these steps to be done in order. Under the advanced editor option menu under the Provisioning Commands section, you can use either device context or primary context.

And CommandFiles is to add a script file.

 

Script.cmd is where you run anything and where logs are created. Here’s a sample script that sets the REG key and runs everything in order, so it’ll pass the HP Validation process. This specific script is to change the Product ID for example from Pro to Enterprise.

@echo off

::::::::::::::::::::::::::::::::::::::::::::::::::::::

::Set Product Key Here

::::::::::::::::::::::::::::::::::::::::::::::::::::::

set ProductKey=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

::::::::::::::::::::::::::::::::::::::::::::::::::::::

:selfelevate

cls

echo.

echo Elevating to Administrator...

echo.

setlocal DisableDelayedExpansion

set "batchPath=%~0"

for %%k in (%0) do set batchName=%%~nk

set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"

setlocal EnableDelayedExpansion

:checkPrivileges

NET FILE 1>NUL 2>NUL

if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )

:getPrivileges

if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)

echo Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%"

echo args = "ELEV " >> "%vbsGetPrivileges%"

echo For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%"

echo args = args ^& strArg ^& " " >> "%vbsGetPrivileges%"

echo Next >> "%vbsGetPrivileges%"

echo UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%vbsGetPrivileges%"

"%SystemRoot%\System32\WScript.exe" "%vbsGetPrivileges%" %*

exit /B

:gotPrivileges

setlocal & pushd .

cd /d %~dp0

if '%1'=='ELEV' (del "%vbsGetPrivileges%" 1>nul 2>nul & shift /1)

::::::::::::::::::::::::::::::::::::::::::::::::::::::

:start

cls

echo.

echo Changing Product Key...

echo.

changepk.exe /ProductKey %ProductKey%

if not "%errorlevel%"=="0" goto fail

if "%errorlevel%"=="0" goto success

:success

cls

echo.

echo Product Key Changed Successfully...

echo.

reg add HKEY_LOCAL_MACHINE\SOFTWARE\HP\InstalledProducts\ProvisioningPackage\ /v "PPKG" /t REG_SZ /d "Installed" /f

reg add HKEY_LOCAL_MACHINE\SOFTWARE\HP\InstalledProducts\ProvisioningPackage\ /v "GeneralizePostInstall" /t REG_SZ /d "false" /f

goto end

:fail

cls

echo.

echo Product Key Change Failed...

echo.

reg add HKEY_LOCAL_MACHINE\SOFTWARE\HP\InstalledProducts\ProvisioningPackage\ /v "PPKG" /t REG_SZ /d "Failed" /f

goto end

:end

pause

exit

Author : michael.mcmahon