✦   Licensed to FixIndependent AI & IT resources
›_ Licensed to Fix
WINDOWS · LICENSING · ABOUT 2 MINUTES

windows-oem-key

Bought your work laptop and now it shows "Activate Windows"? Many laptops sold with Windows preinstalled have the original product key stored in the firmware. One PowerShell command, run as administrator, reads that key, installs it and activates Windows. Built-in Windows tools only.

THE PROBLEM

Why the watermark appears

While a company manages a laptop, Windows is often activated through the company's own volume license. After you buy the laptop and it leaves the company's management, that license may no longer work, and Windows shows the watermark. If the manufacturer stored an OEM key in the firmware, the command below switches Windows to that key and activates it.

Drawing of a Windows desktop with the Activate Windows watermark in the bottom-right corner
ILLUSTRATIONThe "Activate Windows" watermark in the bottom-right corner of the desktop.
PART 1 · THE SCRIPT

Copy the command

Install the OEM key from the firmware and activate, without pasting a key (Administrator window):
PowerShell⛨ Run as Administrator
$k=(Get-CimInstance SoftwareLicensingService).OA3xOriginalProductKey; cscript //nologo $env:windir\System32\slmgr.vbs /ipk $k; cscript //nologo $env:windir\System32\slmgr.vbs /ato

!Before you run it: 4 requirements

  1. Administrator window. Open PowerShell with Run as administrator. In a normal PowerShell window the install fails with "Access denied".
  2. Same edition. The firmware (motherboard) key must match the installed Windows edition. A Home key won't activate Pro. This is the most common reason it fails.
  3. Internet connection. Required for the activation step (/ato).
  4. A key in the firmware. Older or self-built PCs don't have one. Then $k is empty and the command returns an error, with no harm done.
PowerShell script (.ps1)

Prefer to read every line first? The same three commands as a commented script. Open it in Notepad, read it, then copy the commands into an Administrator PowerShell window.

Download PowerShell script (.ps1)
PART 2 · THE EXPLANATION

Open, run, read the result

01

Open PowerShell as Administrator
Click Start, type PowerShell, and under Windows PowerShell choose Run as administrator. When Windows asks to allow changes, click Yes. The window title starts with Administrator:. A normal PowerShell window is not enough: installing a product key needs administrator rights.

Drawing of the Windows 11 Start search with PowerShell typed and Run as administrator highlighted
ILLUSTRATIONStart › type PowerShell › Run as administrator › Yes.
02

Paste the command and press Enter
Paste the command from Part 1 into the Administrator window and press Enter. It runs three parts, one after the other:

What each part of the command does
PartWhat it does
$k=(Get-CimInstance SoftwareLicensingService).OA3xOriginalProductKeyReads the 25-character product key the manufacturer stored in the laptop's firmware (UEFI) and keeps it in a variable called $k. Nothing is changed yet. If the firmware has no key, $k is empty.
cscript //nologo $env:windir\System32\slmgr.vbs /ipk $kRuns Windows' own licensing tool, slmgr.vbs (Software Licensing Management), from the Windows folder. /ipk means "install product key": it replaces the key Windows uses now (for example the company's volume key) with the key in $k. cscript //nologo shows the result as text in the same window instead of pop-up boxes.
cscript //nologo $env:windir\System32\slmgr.vbs /ato/ato means "activate online": Windows contacts Microsoft's activation servers over the internet and activates with the key that was just installed.
;Separates the three commands so they run one after the other in a single paste.
03

Read the result
A good run shows two messages: the key was installed successfully, then Product activated successfully. The first message prints your full product key, so don't share a screenshot of it. If you see an error with a code like 0xC004… or 0x8007…, write the code down and check Troubleshooting below.

Drawing of an Administrator PowerShell window showing Installed product key successfully and Product activated successfully, with the key hidden
ILLUSTRATIONExample of a good run. The key is hidden. Wording can differ slightly between Windows versions.
PART 3 · CONFIRM

Check that Windows is activated

04

Open Settings › System › Activation
Activation state should say Active. The "Activate Windows" watermark goes away, sometimes only after a restart. Prefer not to use the command? On the same page, Change product key lets you paste a key by hand, then Next and Activate.

Drawing of the Windows 11 Settings Activation page with Activation state Active highlighted
ILLUSTRATIONSettings › System › Activation: Activation state Active.
IF SOMETHING LOOKS OFF

Troubleshooting

∅

No key in the firmware

Older or self-built PCs don't have a key in the firmware. Then $k is empty and the command returns an error, with no harm done. Older laptops often have a key on a sticker instead, or Windows may use a digital license linked to a Microsoft account.

⛨

0x80070005 · Access denied

"The requested action requires elevated privileges." PowerShell was not opened as administrator. Close it, open it again with Run as administrator, and run the command again.

≠

0xC004F050 · Key is invalid

The key can't be used with the Windows edition installed now. The firmware key must match the installed edition: a Home key won't activate Pro. This is the most common reason it fails. If you have Home and the firmware key is Pro, entering it in Settings › System › Activation › Change product key upgrades Windows to Pro.

☁

No internet or 0xC004F074

/ato needs internet: connect and run the command again. 0xC004F074 ("No Key Management Service (KMS) could be contacted") means Windows is still trying the company's volume license, so the /ipk part did not install the new key. Check the message it printed.

⊘

0xC004C003 · Key is blocked

"The activation server determined the specified product key is blocked." That key can't be used to activate. Try Settings › System › Activation › Troubleshoot, or use a different valid license.

⌂

The key belongs to that laptop

An OEM key is tied to the machine it shipped with. It won't activate a different computer, and after a major hardware change such as a new motherboard it may stop working.

BEFORE YOU START

Notes

✧

This changes your Windows product key. It replaces the key Windows uses now with the one from the firmware. Run it only on a computer you own.

✧

Keep the key private. The output shows your full product key. Don't post a screenshot of it.

✧

Only on a laptop you bought and own. Do this after the laptop has been released from the company's management.