If you, like me, have quickly built a new server or VM using the Evaluation download from Microsoft, you will find that when you get your license key and try to plug it in, it won’t work. You cannot simply use an otherwise valid key on an evaluation copy of Windows Server.
But fret not, the solution is quite simple. You merely need to run this command from an elevated command prompt:
DISM /online /Set-Edition:<edition ID> /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula
The Edition ID will be ServerStandard, and then insert your product key. The server will run through the image conversion process, then restart twice.
After the server has restarted, you will need to re-activate the server and enter the Key in again.
It is important to note that if you’ve used an evaluation edition to build a domain controller, you cannot change the edition. You will need to either build a new domain controller, or demote the evaluation edition domain controller, set the version id, and then promote it again.
Joe Hanning, PEI