Activation

https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/dism-windows-edition-servicing-command-line-options

Dism /Online /Get-CurrentEdition
Dism /Online /Get-TargetEditions

Set CD Key and activate:

Dism /online /Set-Edition:<edition name> /AcceptEula /ProductKey:12345-67890-12345-67890-12345

VAMT

LDAP://domain.com??sub?(&(objectClass=computer)(operatingSystem=Windows*))
LDAP://domain.com/OU=subOU,OU=parentOU,DC=domain,DC=com??sub?(&(objectClass=computer)(operatingSystemVersion=6*))

Windows Server 2012 R2

The evaluation version (product ID 00252-10000-00000-AA228) was installed and expired.

The machine would then shutdown every hour.

This solved it:

PS C:\Windows\system32> DISM /online /Get-CurrentEdition

Deployment Image Servicing and Management tool
Version: 6.3.9600.19408

Image Version: 6.3.9600.19397

Current edition is:

Current Edition : ServerStandardEval

The operation completed successfully.

PS C:\Windows\system32> DISM /online /Set-Edition:ServerStandard /AcceptEula /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Deployment Image Servicing and Management tool
Version: 6.3.9600.19408

Image Version: 6.3.9600.19397

Starting to update components...
Starting to install product key...
Finished installing product key.

Removing package Microsoft-Windows-ServerStandardEvalEdition~31bf3856ad364e35~amd64~~6.3.9600.16384
[==========================100.0%==========================]
Finished updating components.

Starting to apply edition-specific settings...
Finished applying edition-specific settings.

The operation completed successfully.
Restart Windows to complete this operation.
Do you want to restart the computer now? (Y/N)