Cart0

Server · activation · 6 min read

How to Activate Windows Server via DISM (2016 to 2025)

Updated

How to Activate Windows Server via DISM (2016 to 2025)

Short answer: To activate Windows Server via DISM, run the Set-Edition command with your key in an elevated prompt. Restart, then confirm the license status. Microsoft documents this method for turning evaluation builds into licensed ones. We'd use it on every release from 2016 to 2025.

To activate Windows Server via DISM, change the edition and install the key in one DISM command, shown below. It also moves a licensed Standard server up to Datacenter in place. On Server Core, with no Settings app, we rely on it. Open an elevated prompt, check the edition, convert, restart.

  1. Open an elevated prompt as administrator.
  2. Read the current edition with Get-CurrentEdition.
  3. List the target editions with Get-TargetEditions.
  4. Set the edition and the key with Set-Edition and /AcceptEula.
  5. Restart and check the activation.
Table comparing DISM and slmgr for Windows Server activation: main job, when to use each, the commands and what to check.
Illustration: DISM changes the Windows Server edition and installs the key, while slmgr activates and checks the license.
Point What to know
Division of labour DISM changes the edition and installs the key; slmgr handles activation status, phone activation and KMS
Standard evaluation Can become retail Standard or retail Datacenter
Datacenter evaluation Can only become Datacenter
Evaluation domain controller Can’t be converted: promote a licensed DC, move the FSMO roles, then demote the eval one
First command, always DISM /Online /Get-TargetEditions; if your target isn’t listed, a clean install is the only path
Versions The same commands on Windows Server 2025, 2022, 2019 and 2016

Why activate Windows Server via DISM?

Three situations. The server runs an evaluation build. You need to change the edition, Standard to Datacenter. Or there’s no GUI at all.

Settings and the slmgr key install simply refuse a retail key on an evaluation. The edition itself has to change first. DISM does both jobs in one command: new edition, new key.

Typical situations where DISM is the right tool:

  • Server Core installations with no desktop, only a command line.
  • Evaluation copies, the 180-day trial, that have quietly become production.
  • Scripted activation across many hosts.
  • A perfectly valid key rejected by slmgr with “This edition cannot be upgraded”.
  • A move from Standard to Datacenter after the VM count grew. The reverse direction isn’t supported.

What you need before you start

  • A product key for the edition you’re converting to. A Standard key for Standard, a Datacenter key for Datacenter.
  • Local administrator rights, in an elevated Command Prompt or PowerShell.
  • Internet access to Microsoft’s activation servers, or a phone for offline activation.
  • A snapshot or backup of the VM. Cheap insurance.

Check which version you run before buying anything. Keys aren’t interchangeable between releases. A Server 2019 key won’t activate Server 2022.

Which edition to convert to is settled in Windows Server 2022 Standard vs Datacenter; the full catalogue is under Windows Server.

Microsoft blocks evaluation-to-retail conversion on an Active Directory domain controller. Promote a second DC on a licensed server and transfer the FSMO roles. Remove AD DS from the evaluation DC, and only then convert it.

How to activate Windows Server via DISM step by step

The full sequence takes about ten minutes plus one restart. It follows the order Microsoft Learn documents for evaluation conversion and for Standard-to-Datacenter upgrades.

  1. Open an elevated prompt. Press Win + X and pick the Terminal or PowerShell entry marked Admin. On Server Core the console you log into is already elevated.
  2. Read the current edition.
  3. List the allowed target editions and write down the exact edition ID you want.
  4. Optionally, save the license terms to a file and read them first.
  5. Set the edition and the key.
  6. Restart when prompted. Expect one or two reboots.
  7. Trigger activation, if it hasn’t happened by itself.
  8. Verify the license status.
Five steps to activate Windows Server via DISM: open an elevated prompt, read the current edition, list the target editions, run Set-Edition with the key, restart and verify with slmgr /dlv.
Illustration: the DISM commands for activating Windows Server, in the order we run them.

Steps 2 to 4, in order:

DISM /Online /Get-CurrentEdition
DISM /Online /Get-TargetEditions
DISM /Online /Set-Edition:ServerStandard /GetEula:C:\license.rtf

Evaluation builds show names like ServerStandardEval or ServerDatacenterEval. A licensed Standard shows ServerStandard.

Step 5, for Standard and then for Datacenter:

DISM /Online /Set-Edition:ServerStandard /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula
DISM /Online /Set-Edition:ServerDatacenter /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula

On a busy VM the second restart phase can sit at “Working on features” for several minutes. That’s normal.

Steps 7 and 8:

slmgr /ato
slmgr /dlv

Look for “License Status: Licensed”, and for a description with no “EVAL” in it.

Part of the command What it does
/Online Works on the running installation
/Get-CurrentEdition Shows the installed edition ID
/Get-TargetEditions Lists the editions this install can move to
/Set-Edition Names the target edition
/ProductKey Installs the key for that edition
/AcceptEula Accepts the license terms without a prompt
/NoRestart Holds the reboot until you choose

We’d run the commands from a local console or a hypervisor console, with RDP as the second choice. The reboot drops your session. If something stalls, you want to see the screen.

DISM edition switches for Windows Server, one by one

DISM has four edition switches, and each one answers a different question. Mixing them up is the usual reason a command fails on a server.

Switch What Microsoft says it does Where it works
/Get-CurrentEdition Displays the edition of the image The running server (/Online) or an offline image
/Get-TargetEditions Lists the editions the image can be changed to The running server or an offline image
/Set-Edition Changes to a higher edition; on a running server it needs /AcceptEula and /ProductKey The running server or an offline image
/Set-ProductKey Enters the key for the current edition after an offline edition change Offline images only

Our habit: /Get-CurrentEdition and /Get-TargetEditions first, every time. The edition you bought isn’t in the target list? Then no key makes /Set-Edition work. And the error? Silent on the why. And DISM never moves a server down to a lower edition. Running a trial? That’s a different job, with its own walkthrough: converting a Windows Server 2022 evaluation to Standard.

DISM limits to know before you activate Windows Server

Microsoft’s page on DISM edition-servicing options ends with a short list of limits. Worth a read before a maintenance window. Here they are, in plain words.

Limit What it means on a server
No lower edition An image can’t be set to a lower edition, and the lowest one never shows up in /Get-TargetEditions
Change once Don’t run /Set-Edition on an image that’s already been moved to a higher edition
Not in Windows PE Edition commands don’t work on a Windows PE image, so recovery media won’t do it
Running server needs the key On a running Windows Server, /Set-Edition must come with /AcceptEula and /ProductKey
Offline images No key is needed for the edition change; add it later with /Set-ProductKey, during setup or in an answer file
Many language packs A 64-bit image with more than 30 language packs needs a 64-bit machine running DISM, or it may run out of memory
Edition settings Edition-specific answer files go in after the edition change

Need the syntax on the server itself? Add /? right after a switch. Then this:

DISM /Online /Get-CurrentEdition /?
DISM /Online /Set-Edition /?

We’d also snapshot before the change, every time. DISM won’t roll an edition back, and a restore point is the only undo you get.

No internet? Offline activation after DISM

Air-gapped servers still activate. DISM sets the edition and the key first. Then slmgr displays the Installation ID.

slmgr /dti
slmgr /atp XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX
  1. Run the first line to see the Installation ID.
  2. On any device with internet, open Microsoft’s Product Activation portal at aka.ms/aoh.
  3. Pass the CAPTCHA. Sign in with a Microsoft account, or a work or school one.
  4. Pick Activate a Microsoft Product, then your Windows Server version.
  5. Type in the Installation ID and note the Confirmation ID the portal gives back.
  6. Enter that Confirmation ID on the server with the second line.

Microsoft moved the old telephone activation online to this portal. Signing in only opens the portal, by Microsoft’s own wording it doesn’t tie your account to the license. Details on the Product Activation portal page.

Annoying? A bit. Reliable? Yes. The Confirmation ID is tied to that hardware, so a reinstall means another round on the portal. The background is in our guide to activate Windows by phone.

Errors when you activate Windows Server via DISM

Most failures come from three things. A key that doesn’t match the target edition. A blocked path to the activation servers. Or a pending servicing operation.

Error What it usually means First fix
0xC004F050 Key not valid for this edition or version Match key to edition and year; see our 0xC004F050 fix guide
0xC004F074 No KMS host reachable Check slmgr /skms, DNS SRV record and port 1688
0xC004C003 Key blocked by the activation server Use a different genuine key or contact the seller
0x800F0922 Servicing operation failed Finish pending updates, reboot, rerun DISM
“Target edition not found” Path not supported (Datacenter to Standard, Core to Desktop) Clean install of the edition you need

One more classic: the activation command seems to show nothing. The Windows Script Host dialog often hides behind other windows. Wait half a minute, then check the license summary.

For the KMS code in particular, our KMS error 0xC004F074 walkthrough covers the DNS and firewall side.

KMS and MAK volume licensing

Volume licensing follows the same pattern. Convert the evaluation to retail with DISM first. Then switch channels with slmgr.

Microsoft documents channel changes as slmgr operations that keep the edition. That covers retail, volume and OEM. Need the public client keys? See Windows Server KMS keys.

slmgr /ipk YOUR-MAK-KEY
slmgr /ato

MAK keys activate online once. KMS clients renew every 180 days against your KMS host.

For KMS, point the client at the host if DNS auto-discovery isn’t set up:

slmgr /skms kms01.contoso.local:1688
slmgr /ato

A KMS host activates servers only after it has seen at least five requesting machines. For Windows client devices the number is 25.

Below that threshold you get 0xC004F038. In most cases it simply tells you to wait for more clients.

Batch script to activate Windows Server via DISM on many servers

A short batch file that takes the key as a parameter covers most small rollouts. The same lines run fine through PowerShell remoting or your RMM tool.

@echo off
DISM /Online /Get-CurrentEdition
DISM /Online /Set-Edition:ServerStandard /ProductKey:%1 /AcceptEula /NoRestart
echo Restart the server, then run: slmgr /ato and slmgr /dlv

Save it as activate.bat and pass the key as the only argument.

  • Keep the key out of the script itself.
  • Log the output.
  • Reboot under control. Don’t let DISM restart hosts at random times.

With the NoRestart switch you choose the maintenance window yourself.

Verify the DISM activation worked

slmgr /xpr
slmgr /dlv
Check What a good result looks like
slmgr /xpr Retail and MAK: the machine is permanently activated. KMS clients: an expiry date
slmgr /dlv Edition, partial key, license channel and status
DISM /Online /Get-CurrentEdition No “Eval” in the edition name

On Desktop Experience servers we also open Settings, System, Activation. Auditors like a screenshot. Every switch used here is in our slmgr commands list.

Which version to choose in 2026

For older hosts, our Windows Server 2016 guide to the risks and the migration options covers the choices.

Converting a 2016 evaluation in late 2026 still works technically. A 2022 or 2025 install is usually the better spend.

Keys for both sit in our store: Windows Server 2025 Standard and Windows Server 2022 Standard.

What Microsoft allows, in one table

Microsoft’s page Convert Windows Server editions and license types sets the rules. We copied them here.

Starting point Can become
Evaluation Standard, Desktop Experience Retail Standard or Datacenter, Desktop Experience
Evaluation Datacenter Retail Datacenter only
Evaluation Standard, Server Core Retail Datacenter Core only, not Standard Core
Any Desktop Experience evaluation Not a Core retail edition
Retail Standard Datacenter, at any time
Retail, volume or OEM of one edition Another license type of the same edition, with slmgr
An evaluation domain controller Nothing; Microsoft says to move the roles to a licensed server first

If the edition you want isn’t in the Get-TargetEditions list, Microsoft’s answer is a fresh installation of that retail edition.

Quick answers

Question Short answer
Can you activate Windows Server via DISM without internet? Yes.
Can you convert Standard evaluation straight to Datacenter? Yes.
What is the difference between DISM and slmgr for activation? DISM changes the edition and installs the key.
Why does DISM say the target edition is not valid? The path isn’t supported.
Can you convert an evaluation domain controller with DISM? Nope.
How many restarts does DISM activation need? Usually one, sometimes two.

FAQ

Can I activate Windows Server via DISM without internet?

Yes. DISM sets the edition and key offline. Then you type the Installation ID into Microsoft's Product Activation portal from any device with internet. We'd enter the Confirmation ID with slmgr as the last step.

Can I convert Standard evaluation straight to Datacenter?

Yes. Microsoft lets a Standard evaluation with Desktop Experience become retail Standard or retail Datacenter. A Datacenter evaluation can only become Datacenter. And Desktop Experience can't be switched to Core.

What is the difference between DISM and slmgr for activation?

DISM changes the edition and installs the key. That's the only way out of an evaluation build. The slmgr tool installs keys within the same edition and switches license channels. We'd also use it to activate and to show status.

Why does DISM say the target edition is not valid?

The path isn't supported. Typical examples are Datacenter to Standard, or Desktop Experience to Server Core. List the target editions first. If yours is missing, we'd plan a clean install.

Can I convert an evaluation domain controller with DISM?

Nope. Microsoft blocks it. Add a domain controller on a licensed server and transfer the FSMO roles. Remove AD DS from the evaluation server. Then we'd convert or rebuild it.

How many restarts does DISM activation need?

Usually one, sometimes two. The edition change applies during the restart. With the NoRestart switch you pick the maintenance window yourself, and we'd use it on production hosts.