I've been working a lot with WCD recently, and have been experiencing issues whereby the Bulk Token is expiring. Which led me down the path of finding ways to recreate the bulk token for an existing provisioning package. As a result, I stumbled across Michael's blog post at Simplify the process of generating an AAD bulk enrollment provisioning package – Out of Office Hours (oofhours.com)
Which then sent me down another rabbit hole, of wondering if I could simply create my desired PPKG automagically, using this code.
Seeing that Michaels script simply builds the XML on the fly, I thought I could be clever and simply throw in the XML code from customisations.xml which was generated by the WCD GUI.
In doing so, this returned errors similar to the above.
Reviewing the generated log file referenced in the error, hinted at the Store File being the issue.
| 12/29/2023 1:17:59 PM Info StoreFile path: C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Imaging and Configuration Designer\x86\Microsoft-Common-Provisioning.dat 12/29/2023 1:17:59 PM Info Loaded Knobs schema hive at C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Imaging and Configuration Designer\x86\Microsoft-Common-Provisioning.dat 12/29/2023 1:17:59 PM Error WpxGetFileEdition (onecore\base\ntsetup\wpx\core\store.cpp:103) - 0x80070002: 12/29/2023 1:17:59 PM Error No SKU information file C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Imaging and Configuration Designer\x86\Microsoft-Common-Provisioning.sku.xml available for store file C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Imaging and Configuration Designer\x86\Microsoft-Common-Provisioning.dat 12/29/2023 1:17:59 PM Info Loaded settings from Windows Unknown Unknown 12/29/2023 1:17:59 PM Error WpxConfig::FindSchema (onecore\base\ntsetup\wpx\core\config.cpp:162) - 0x80070490: 12/29/2023 1:17:59 PM Error Couldn't find schema path for DevDetail under / 12/29/2023 1:17:59 PM Error WpxSetting::GetChild (onecore\base\ntsetup\wpx\core\setting.cpp:249) - 0x80070490: 12/29/2023 1:17:59 PM Error Couldn't find schema for answer path /DevDetail 12/29/2023 1:17:59 PM Error WpxWpafReader::ReadSettingsTree (onecore\base\ntsetup\wpx\file\wpafreader.cpp:628) - 0x8007000d: 12/29/2023 1:17:59 PM Error Unrecognized child DevDetail specified for tree setting / 12/29/2023 1:17:59 PM Error WpxWpafReader::ReadCommonSettings (onecore\base\ntsetup\wpx\file\wpafreader.cpp:197) - 0x8007000d: 12/29/2023 1:17:59 PM Error Couldn't read common settings 12/29/2023 1:17:59 PM Error WpxWpafReader::Read (onecore\base\ntsetup\wpx\file\wpafreader.cpp:78) - 0x8007000d: 12/29/2023 1:17:59 PM Error Failed to read common settings node 12/29/2023 1:17:59 PM Error WpxConfig::ReadAnswerFile (onecore\base\ntsetup\wpx\core\config.cpp:598) - 0x8007000d: 12/29/2023 1:17:59 PM Error Failed to load answer file 12/29/2023 1:17:59 PM Error The following errors were detected in customizations: Settings were not found in the store file. Parse error (0x80070490): 'DevDetail' is not a valid child node for / 12/29/2023 1:17:59 PM Error Microsoft.Windows.ICD.Common.Exceptions.CustomizationsException: The following errors were detected in customizations: Settings were not found in the store file. Parse error (0x80070490): 'DevDetail' is not a valid child node for / at Microsoft.Windows.ICD.Provisioning.ImageCustomization.ImageCustomizations.ReadAndValidateWPXAnswerFile(Config wpxConfig, XDocument wpxDocument, Boolean ignoreWpxParseErrors) at Microsoft.Windows.ICD.Provisioning.ImageCustomization.ImageCustomizations.Load(XDocument customizationsXDoc, Boolean onlySettings, Boolean ignoreWpxParseErrors) at Microsoft.Windows.ICD.Provisioning.ImageCustomization.ImageCustomizations.CreateAndLoadAnswers(XDocument customizationsXDoc, IStoreConfig storeConfig, Boolean ignoreWpxParseErrors, Boolean isMobile) at Microsoft.Windows.ICD.Core.Common.Project.LoadCustomizations(XDocument customizationsXDoc) at Microsoft.Windows.ICD.Core.Common.Project.CreateFromStoreFile(IEnumerable`1 storeFilePaths, String location, XDocument customizationsXDoc, InvocationMode invocationMode) at Microsoft.Windows.ICD.Core.CLI.BuildPackageCmdHandler.Execute() |
|---|
Being familiar with Windows Configuration Designer and Answer Files and what not, I am familiar with the different layers and levels of customisations. As such, I explored the Store File referenced, and found there is a variety of Provisioning DAT files. (HoloLens, Desktop, Team, Mobile etc)... as an attempt at a quick fix, I simply renamed Microsoft-Desktop-Provisioning.dat to Microsoft-Common-Provisioning.dat, backing up the old file in the process, and attempted to generate the PPKG again using Michaels script.
This time it was a success. Suggesting that the COMMON.dat being called by default isn't all encompassing.
Further reading of the ICD help articles on the Microsoft site revealed that you can indeed call the specific Store file, so appending /StoreFile:"$kitsRoot\Assessment and Deployment Kit\Imaging and Configuration Designer\x86\Microsoft-Desktop-Provisioning.dat" should work, but it seems like there's a bug in ICD preventing more than two params being called.
As such, I created a hacky song and dance in the script that renames the existing Microsoft-Common-Provisioning file, creates a copy of the Desktop file in its place, creates the package, and then returns things to normal.
See Improve the process of generating an AAD bulk enrollment provisioning package – James Vincent