Getting windows setup to check for firmware product key, digital license then fall back to a prompt with autounattend.xml


AIT

New member
Local time
4:32 AM
Posts
2
OS
Linux Mint
I've recently set up a PXE server at work (small pc repair shop) that lets me create/restore WIM files from windows PE but, not being very proficient at writing autounattend.xml files I've been using the excellent https://schneegans.de/windows/unattend-generator/ to generate autounattend.xml files that I pass to sysprep which works well but when it comes to licensing the site give me 4 options

  • use generic product key for home/pro/enterprise/education
  • interactively enter product key in windows setup
  • Use product key stored in BIOS/UEFI firmware
  • specify product key in unattend file
I initially created separate wim files for options 1-3 and this is where things get confusing. Using the option to prompt interactively actually does check for a digital key and bypasses the prompt if it finds one. And I used an unactivated win11 pro for my base install but when I tried it on a machine that had a win11 home digital license it silently failed and installed unactivated. I made a new install of win11 home and it worked but now I'm looking at maintaining 12 different wim files and having to install a random windows, then click activation trouble-shooting to find which license it has and I'm thinking there has to be a better way. Looking at the different unattend.xml files it seems the main difference between a firmware lookup and interactively entering the product keys is the firmware option has

<ProductKey>
<Key>00000-00000-00000-00000-00000</Key>
<WillShowUI>OnError</WillShowUI>
</ProductKey>

And the interactive prompt uses <WillShowUI>Always</WillShowUI> Is it possible that using OnError here would also check for a firmware product key? I don't have any machines with a firmware product key to test on but if I could just maintain 4 wim files for home/pro/ent/edu that would be more feasible. Also does anyone know of an app/url that will tell me if a machine has a digital license and what sort?
 
Windows Build/Version
1124h2

My Computer

System One

  • OS
    Linux Mint
    Computer type
    PC/Desktop
Hi and welcome.

Autounattend is out of my league, but if you’re using an ISO to install, you could inject an ei.cfg file into the ISO.

A previous post of mine here:

If anyone ever wants to bypass the BIOS version restrictions, you can edit a multi edition Windows.iso

  • Open notepad and enter the following
Code:
[Channel]
Retail
  • Save the file as ei.cfg
  • Place the file in the ISO sources folder.
During installation you will be asked what version of Windows you would like to install.​
OR

Code:
[EditionID]
{Edition}

[Channel]
Retail

[VL]
0

Replace the line {Edition} with the Windows edition you want to install.
EditionID can be: Home, Professional, Enterprise, Education, and so on, depending on the available editions in your specific Windows ISO

For example:

Code:
[EditionID]
Home

[Channel]
Retail

[VL]
0

Channel can be changed to Retail or OEM

You can also create a pid file and pre enter your product key.

  • Open notepad and enter the following:
Code:
[PID]
Value=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
  • Save the file as pid.txt
  • Place it into the sources folder
Replace XXXXX-XXXXX-XXXXX-XXXXX-XXXXX with your product key. If you don’t have a product key or you want to manually enter it later just skip creating the pid.txt file.​
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 Build 22631.5335
    Computer type
    PC/Desktop
    Manufacturer/Model
    Sin-built
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (4th Gen?)
    Motherboard
    ASUS ROG Maximus VI Formula
    Memory
    32.0 GB of I forget and the box is in storage.
    Graphics Card(s)
    Gigabyte nVidia GeForce GTX 1660 Super OC 6GB
    Sound Card
    Onboard
    Monitor(s) Displays
    5 x LG 25MS500-B - 1 x 24MK430H-B - 1 x Wacom Pro 22" Tablet
    Screen Resolution
    All over the place
    Hard Drives
    Too many to list.
    OS on Samsung 1TB 870 QVO SATA
    PSU
    Silverstone 1500
    Case
    NZXT Phantom 820 Full-Tower Case
    Cooling
    Noctua NH-D15 Elite Class Dual Tower CPU Cooler / 6 x EziDIY 120mm / 2 x Corsair 140mm somethings / 1 x 140mm Thermaltake something / 2 x 200mm Corsair.
    Keyboard
    Corsair K95 / Logitech diNovo Edge Wireless
    Mouse
    Logitech: G402 / G502 / Mx Masters / MX Air Cordless
    Internet Speed
    1000/400Mbps
    Browser
    All sorts
    Antivirus
    Kaspersky Premium
    Other Info
    I’m on a horse.
  • Operating System
    Windows 11 Pro 23H2 Build: 22631.4249
    Computer type
    Laptop
    Manufacturer/Model
    LENOVO Yoga 7i EVO OLED 14" Touchscreen i5 12 Core 16GB/512GB
    CPU
    Intel Core 12th Gen i5-1240P Processor (1.7 - 4.4GHz)
    Memory
    16GB LPDDR5 RAM
    Graphics card(s)
    Intel Iris Xe Graphics Processor
    Sound Card
    Optimized with Dolby Atmos®
    Screen Resolution
    QHD 2880 x 1800 OLED
    Hard Drives
    M.2 512GB
    Antivirus
    Defender / Malwarebytes
    Other Info
    …still on a horse.
I entirely disagree with Schneegan over one key point: You can leave <ProductKey> blank and it still works.

With a blank <ProductKey>, it works for any Windows retail edition and will automatically allow Windows to self-activate if an OEM product key is found in BIOS, or Windows connects online and later does digital activation. Setting ProductKey to all zero's prevents this method, because all zero's is neither a valid OEM key or a valid generic install key.

The bare minimum XML to skip Windows activation (during install) is:
Code:
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="specialize">
                <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <SkipAutoActivation>true</SkipAutoActivation>
                </component>
        </settings>
        <settings pass="windowsPE">
                <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <ImageInstall>
                                <OSImage>
                                        <InstallFrom>
                                                <MetaData wcm:action="add">
                                                        <Key>/IMAGE/INDEX</Key>
                                                        <Value>1</Value>
                                                </MetaData>
                                        </InstallFrom>
                                </OSImage>
                        </ImageInstall>
                        <UserData>
                                <ProductKey>
                                        <Key></Key>
                                </ProductKey>
                        </UserData>
                </component>
        </settings>
</unattend>

Update your Schneegan file to contain these elements.

The other method is very intensive. First you create a master unattended file. Now clone it several times and add the generic keys for Home/Pro/Ent/EDU. Save this answer file as \Windows\Panther\unattend.xml inside each mounted image, on a per-image basis.

Yeah that doesn't sound enticing, or labor saving. Which means if you make a new unattended file, you're looping back and updating all those images. With the blank ProductKey method, you only need one unattended file which can be shared.
 

My Computer

System One

  • OS
    Windows 7
  • Great Support
Reactions: AIT
sorry, I seem to have missed the part about multiple pc’s
I also neglected that Garlin was online :p
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 Build 22631.5335
    Computer type
    PC/Desktop
    Manufacturer/Model
    Sin-built
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (4th Gen?)
    Motherboard
    ASUS ROG Maximus VI Formula
    Memory
    32.0 GB of I forget and the box is in storage.
    Graphics Card(s)
    Gigabyte nVidia GeForce GTX 1660 Super OC 6GB
    Sound Card
    Onboard
    Monitor(s) Displays
    5 x LG 25MS500-B - 1 x 24MK430H-B - 1 x Wacom Pro 22" Tablet
    Screen Resolution
    All over the place
    Hard Drives
    Too many to list.
    OS on Samsung 1TB 870 QVO SATA
    PSU
    Silverstone 1500
    Case
    NZXT Phantom 820 Full-Tower Case
    Cooling
    Noctua NH-D15 Elite Class Dual Tower CPU Cooler / 6 x EziDIY 120mm / 2 x Corsair 140mm somethings / 1 x 140mm Thermaltake something / 2 x 200mm Corsair.
    Keyboard
    Corsair K95 / Logitech diNovo Edge Wireless
    Mouse
    Logitech: G402 / G502 / Mx Masters / MX Air Cordless
    Internet Speed
    1000/400Mbps
    Browser
    All sorts
    Antivirus
    Kaspersky Premium
    Other Info
    I’m on a horse.
  • Operating System
    Windows 11 Pro 23H2 Build: 22631.4249
    Computer type
    Laptop
    Manufacturer/Model
    LENOVO Yoga 7i EVO OLED 14" Touchscreen i5 12 Core 16GB/512GB
    CPU
    Intel Core 12th Gen i5-1240P Processor (1.7 - 4.4GHz)
    Memory
    16GB LPDDR5 RAM
    Graphics card(s)
    Intel Iris Xe Graphics Processor
    Sound Card
    Optimized with Dolby Atmos®
    Screen Resolution
    QHD 2880 x 1800 OLED
    Hard Drives
    M.2 512GB
    Antivirus
    Defender / Malwarebytes
    Other Info
    …still on a horse.
That ei.cfg brings back memories of windows 7 days when I used something similar but FYI autounattend.xml is even simpler with scheegans and a windows install usb key, just copy the autounattend.xml file the site gives you into the top level of your windows USB key and you're good to go, no iso injections needed although I presume you could also inject it into the top level of an iso. It gives you several nifty options like bypassing oobe and autocreating a local user, bypassing the hardware requirement and even making edge uninstallable. Definitely worth a try even if you're not planning to build your own WIM images.
 

My Computer

System One

  • OS
    Linux Mint
    Computer type
    PC/Desktop
You don't need multiple Wim files, just use the ISO download from Microsoft. However, you'll need multiple unattended.xml files, One for each Windows edition ie. Home, Pro....
1. Go to the website and create an autoattended file for Home using generic key for HOME then download it.
2. While still on the website, make the change for PRO, download. Repeat step 1 and 2 for other Editions.
3. Mount the Windows ISO using index 1 for HOME, navigate to Windows folder on the mounted folder,
create a folder and rename Panther. Rename autounattended.xml to Unattended.xml then copy it to this folder. Commit change then unmount it.
4. repeat step 3 for other editions.

NOTE: Windows will be activated if the pc has license key in the BIOS/Digital Activation.

In the future, if you need to modify any unattened files, open the website then click on import to make modification.

Hope this help.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2, Linux Mint 21.3
    Computer type
    PC/Desktop
    Manufacturer/Model
    Self Build Feb.2024
    CPU
    Intel Core i9-14900K @5.8GHZ
    Motherboard
    MSI MAG Z790 Tomahawk Max WiFi 7
    Memory
    64GB (2XG Skill F5-6400J3239G32G) @6800
    Graphics Card(s)
    Radeon (TM) RX 480 Graphics (8 GB)
    Sound Card
    Intergrated Realtek
    Monitor(s) Displays
    Samsung
    Screen Resolution
    3840x2160
    Hard Drives
    2 x Crucial T500 2TB Gen4
    PSU
    750W EVGA-G3
    Case
    Antec NX410
    Cooling
    H2O Thermalright
    Keyboard
    Logitech K800
    Mouse
    Logitech Master 2S
    Internet Speed
    100 Mbps
    Browser
    Chrome
    Antivirus
    WD
  • Operating System
    Windows 10 & 11 Pro & Linux Mint X64
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI Z77 MPower (MS-7751)
    CPU
    Intel(R) Core(TM) i7-3770K CPU @ 4.20 GHz
    Motherboard
    Z77 MPower (MS-7751)
    Memory
    32.0GB Dual-Channel CMY16GX3M2A1600C9
    Graphics card(s)
    NVIDIA GeForce GT 740
    Monitor(s) Displays
    40" Samsung
    Screen Resolution
    1920X1080
    Hard Drives
    WIN10 - 111GB Samsung SSD 840 Series
    WIN11 - 223GB Crucial CT240BX500SSD
    2X931GB Crucial CT1000BX500SSD1
    PSU
    Antec 850W
    Case
    Antec 900
    Cooling
    H20
    Mouse
    Logitech MX Master 2S
    Keyboard
    Logitech K800 Wireless
    Internet Speed
    100 Mbps
    Browser
    Chrome
    Antivirus
    Windows Defender

Latest Support Threads

Back
Top Bottom