Automatic assignment of Images based of Product Key



  • Good day

    I am looking to automate the deployment based on the license key extracted.

    I currently extract the Windows license key from the BIOS, then use 3rd party tools such as ShowKeyPlus or PID checker to determine the OS version needed for the install. I then assign the OS version to the host and deploy.

    What I wanted to know is it possible to extract the license key and determine the image to be assigned to the host automatically without the manual process of using 3rd party software applications?


  • Moderator

    @zaboxmaster That command is surely possible if the existing hard drive contents are available. My previous post was only considering a bare metal install where there was no previous windows install to reference. If you have access to the previous disk content and it matches the smbios key then it makes things a bit easier.

    If you look at this post for a post install script example you will see a command that is already built into FOS linux called reged https://forums.fogproject.org/topic/8889/fog-post-install-script-for-win-driver-injection/57 In this example I’m poking a value into the registry. While I haven’t looked it may be possible to read with reged too. As for hivesh it could be added if the source code could be found. It could be integrated into FOS Linux. It might take a little work, but its possible if that IS the solution.

    edit: man page for reged http://manpages.ubuntu.com/manpages/bionic/man8/reged.8.html



  • @george1421 Just thinking out of the box here, and I understand I might be barking up the wrong tree, but could something like this work ?

    https://linux.die.net/man/1/hivexsh

    Would it then be possible to install this in fog and use this a function ?

    As from there I should be able to pull the Windows version out from the registry, in theory.

    As I have said before I am still learning .


  • Moderator

    @zaboxmaster Conceptually speaking its possible to extract a bios key and then update the unattend.xml file with that key so the system activated. There is no way that I know of that key 123 is for OS Win8 and key 345 is for Win10. The only group that can tell you that is MicroSoft.

    Recently I was looking through the FOG Project code and I recognized this line: https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.auto.reg#L70 That might be the link to extract the product key from SMBIOS. If someone might couple that with a fog post install script: https://forums.fogproject.org/topic/8889/fog-post-install-script-for-win-driver-injection/50?_=1584044949796 They could get near touchless system activation. But that still wouldn’t get you the os detection. Understand some of these actions may be against the intent of the MS EULA. So I’m only talking about the concepts of not the action there of.

    Since it appears that you are functioning as an MSP or system rebuilder there is a process that I call “Load and Go”, where you pick the deploy image ipxe menu select the image and then deploy the image to the target computer. In this method you don’t register the computer because once its imaged FOG will never see the computer again. This load and go approach makes it a bit quicker to image the machine. Postinstall scripts are run to name the machine if necessary or do other post imaging cleanup.



  • @Sebastian-Roth You would be correct in the approach . Its an image once then forget. I am not using any tool to extract just a command which assigns the value to a variable and prints it out.

    I then manually input the product key into a third party tool.

    Do you know of any tools that could do the trick ?

    Yes I do a full registration of the host then deploy .


  • Senior Developer

    @zaboxmaster From what you write it sounds as if you are using FOG as a “image once and forget” kind of solution. Do you actually register the machines or do you use the image deploy directly from the FOG menu?

    What kind of tool do you use to extract the key from the BIOS? Depending on the tools used to extract and check OS version being available as Linux command line tools you might be able to automate this process.


Log in to reply
 

254
Online

7.1k
Users

14.3k
Topics

135.1k
Posts