Run Command Prompt with Administrator Privileges and run following command:slmgr.vbs -rearm
Restart Windows Server 2012 R2.
To update the license for Windows Server 2019, you need to enter the following command:
slmgr -rearm
Restart Windows Server 2019.