Giter Club home page Giter Club logo

Comments (8)

AkosBakos avatar AkosBakos commented on July 29, 2024

I think it could be hard to automate, because the use case is for every user/customer different.
--> if you need this activation, you can simply extend your code with these lines:
https://github.com/AkosBakos/OSDCloud/blob/main/Install-EmbeddedProductKey.ps1

from osd.

Abe-Telo avatar Abe-Telo commented on July 29, 2024

Thank you, i will test it, I assume we use it by adding a line

Invoke-Expression (Invoke-WebRequest -Uri "https://github.com/AkosBakos/OSDCloud/blob/main/Install-EmbeddedProductKey.ps1" -UseBasicParsing).Content

Correct?

from osd.

AkosBakos avatar AkosBakos commented on July 29, 2024

Or simply like that:
Start-Process PowerShell -ArgumentList "-NoL -C Invoke-WebPSScript "https://github.com/AkosBakos/OSDCloud/blob/main/Install-EmbeddedProductKey.ps1" -Wait

from osd.

Abe-Telo avatar Abe-Telo commented on July 29, 2024

Or simply like that:
Start-Process PowerShell -ArgumentList "-NoL -C Invoke-WebPSScript "https://github.com/AkosBakos/OSDCloud/blob/main/Install-EmbeddedProductKey.ps1" -Wait

I can confirm it works in windows, but doesn't seem to work in WinPE. Normal behavior?

In windows I ran the 1.cmd in system32 from his script and it worked.

from osd.

AkosBakos avatar AkosBakos commented on July 29, 2024

Check the log file: $env:ProgramData\Microsoft\IntuneManagementExtension\Logs\OSD\Install-EmbeddedProductKey.log
--> if the device has a HW license, it doesn't matter in which phase is getting executed.

from osd.

Abe-Telo avatar Abe-Telo commented on July 29, 2024

@AkosBakos, I believe in WinPE we will get Invalid class "SoftwareLicensingService"
Since i am using PowerShell and not CMD to run my script, I used these 2 lines of code.

$EmbeddedProductKey= "https://raw.githubusercontent.com/AkosBakos/OSDCloud/main/Install-EmbeddedProductKey.ps1"
Invoke-Expression (Invoke-WebRequest -Uri $EmbeddedProductKey-UseBasicParsing).Content

Here is the log file you requested. Tested on 2 Surface Books.
Here is how i have it implemented online on line 60.
https://github.com/Abe-Telo/ODSCloud-Missing-Microsoft-Drivers/blob/main/online.ps1

**********************
Transcript started, output file is X:\ProgramData\Microsoft\IntuneManagementExtension\Logs\OSD\2023-11-15-140536-Install-EmbeddedProductKey.log
Get embedded product key
Get-WmiObject : Invalid class "SoftwareLicensingService"
At line:5 char:9
+ $Key = (Get-WmiObject SoftwareLicensingService).OA3xOriginalProductKe ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidType: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
Get-WmiObject : Invalid class "SoftwareLicensingService"
At line:5 char:9
+ $Key = (Get-WmiObject SoftwareLicensingService).OA3xOriginalProductKe ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidType: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

No embedded product key found.
**********************

from osd.

gwblok avatar gwblok commented on July 29, 2024

The OSD Module has functions for getting the embedded code, and for applying it to the OS.
https://github.com/OSDeploy/OSD/blob/master/Public/OSDCloudTS/Set-WindowsOEMActivation.ps1

image

It has worked pretty well for me in my process, applying the Key from older devices and activating Windows 11, but sadly I've had poor luck lately: https://www.zdnet.com/article/can-you-still-get-a-windows-10-upgrade-for-free/

Still works find on newer hardware.

If you OEMActivation = $true in your OSDCloud variables, it should automatically try to get the key and apply it for you.
See my OSDCloud script example: https://github.com/gwblok/garytown/blob/master/Dev/CloudScripts/win11.ps1

from osd.

gwblok avatar gwblok commented on July 29, 2024

Describe the solution you'd like It would be cool to get the Windows type based on the Embedded Windows Key from the bios. Such as Windows 10 Home, Pro, Enterprise, etc. It would be even cooler If the tool could tell us if the Product key can be used for Win 10 and Win 11.

I was thinking of even a step forward and filtering the Windows selection from the OSDCloudGUI Menu based on the product key.

What this resolves Sometimes I have Windows 10 Pro, But I install Home. Sometimes I want to downgrade from Windows 11 to 10, And not sure if the product key allows it.

Having something like this implemented can save alot of time.

I just looked back at the original request, which is different then what I was thinking.
While it's a cool idea, I don't know of a way to do a look up on the OEM code and get the OS it is for. If you know of a way to do this, let me know and I can see if I can work it into the process.

Today, the best way to do this would be to write a custom script to kick off OSDCloud, have it check for a list of models you image that are known to be Pro, and then have do something like
if (Activation -eq "Pro"){$Activation = "Pro"}
Else {$Activation = "Home"}
Then feed that into your Start-OSDCloud Command line.

Considering this Issue closed unless someone provides a method to do a lookup on the MS Activation Code in the Firmware.

from osd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.