Windows server 2012 change product key:
How to change the product key in Server 2012 or Windows 8
Open an elevated command prompt and type the following commands:
Run this command to remove the old key:
slmgr -upk
Run this command to apply a new key:
slmgr -ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx