DeploymentResearch / DRFiles

Sample files for the Deployment Research Blog
MIT License
368 stars 323 forks source link

Selecting OS to install based on OEM license #40

Open fthobe opened 1 month ago

fthobe commented 1 month ago

Hey folks,

Thank you for your hard work, your blog and GitHub repo was a significant source of information to learn mdt better.

We are refurbishing computers to give away to schools.

Your script to fix UEFI recognition was of immense help but I am stuck with one issue: The devices we receive have various different OEM licenses installed and it seems like former users can't help themselves and peel off the license stickers.

We have made great steps forward regarding identifying the license post installation with powershell running Get-WmiObject 'SoftwareLicensingService' as querying OA3xOriginalProductKeyDescription returns the effective version. We do significantly struggle determining that during deploy though and setting a variable to determine the right OS to install.

Any ideas how that would look like? I saw @jarwidmark did some work on KeyChecks but I can't figure out how it all plays nicely together as I am very new to MDT.

Fab

arwidmark commented 1 month ago

The SoftwareLicensingService WMI class is not available in WinPE, but I've seen folks having success with the RWEverything tool (rw.exe) to read license info. I haven't tried it myself, though. Below is a PowerShell script that does the same as well: https://github.com/aslakt/deploy/blob/b55142cc3e2ec307cf7922356dd7f68e4984909e/ZeroTouchProvisioning/Scripts/GetMSDMProductKey.ps1#L18

fthobe commented 1 month ago

Hey, thank you for your reply!

I read the documentation regarding the activation of windows post install including upgrading from home to pro. Do you have experiences with that and sysprep?

arwidmark commented 1 month ago

I updated the post with a script as well, but as far as activation goes, Sysprep is not involved in that. If you have a retail or MAK key you can use, you can simply install a new key.