For Windows Server 2008 R2, enter a product key by typing the following at a command prompt:
slmgr.vbs –ipk
Then, for both Windows Server 2008 R2 and Windows Server 2008, activate the server by typing the following at a command prompt:
slmgr.vbs -ato
If activation is successful, no message will return in the command prompt.