If you're encountering activation issues on a device that's been restarted using a USB stick or Intune Wipe/Fresh Start, even though you have a valid BIOS Windows key, don't worry. You can use PowerShell and a WMI query to retrieve the key and activate Windows. In this article, we'll guide you through the process of Windows activation with BIOS keys in Intune.

Windows Activation with BIOS Key

Sometimes, after a device restart using a USB stick or Intune Wipe/Fresh Start, Windows may not activate automatically, even if you have a valid BIOS Windows key. To resolve this, you can utilize PowerShell and a WMI query to activate Windows using the BIOS key.

# Windows activation with BIOS Key
if((Get-CimInstance -ClassName SoftwareLicensingProduct | Where-Object {$_.name -match 'windows' -AND $_.PartialProductKey}).LicenseStatus -ne '1'){
    Write-Host "BIOS Key wird aktiviert"
    slmgr /ipk (Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey
    slmgr /ato
}Code language: PowerShell (powershell)

This script can be deployed to all your devices. If a device is already activated via BIOS, MAK, or KMS, the script will have no effect.

Windows Activation with MAK Key

But what if you want to address devices without a BIOS key? You can save a MAK key and use it for activation in case these devices are not activated. Here's how:

# Windows activation with MAK key
$MAK = "AAAAA-BBBBB-CCCCC-DDDDD-EEEEE"
if((Get-CimInstance -ClassName SoftwareLicensingProduct | Where-Object {$_.name -match 'windows' -AND $_.PartialProductKey}).LicenseStatus -ne '1'){
    Write-Host "MAK Key wird aktiviert"
    slmgr /ipk $MAK
    slmgr /ato
}Code language: PowerShell (powershell)

Both scripts should be saved as PS1 files for distribution, and you can then upload them to Intune. Follow these steps:

  1. Go to "Devices" > "Windows" > "PowerShell scripts" in Intune.
  2. Click "+ Add" to upload the script.
  3. Assign a suitable name and upload the script.
  4. Finally, assign the script to the relevant devices.

By following these steps, you can ensure that your Windows devices are activated correctly using BIOS keys and Intune, even if they've undergone a restart or refresh process. This streamlined activation process can save you time and effort in managing your Windows devices.