Occasionally Windows Server 2019 or Windows 10 will get "stuck" and not allow to change/register the product key. To resolve, follow the steps below.
- Click Start and type CMD in the Start Search menu
- Right Click and choose Run as administrator
- To remove any existing product key (in case you used a trial key), enter and run the command slmgr.vbs /upk .
- Clear the product key from registry by running slmgr.vbs /cpky
- To enter your new product key, use the command: slmgr.vbs /ipk xxxxx-xxxxx-xxxxx-xxxxx where the x’s are your actual product key.
- Lastly, activate Windows by entering the command slmgr.vbs /ato
- Windows is now activated.
Source - https://technogecko.net/guides/change-product-key-does-nothing-windows-server-2019-windows-10-1809/