The problem
A license database for remote desktop in Windows 2012 got corrupted as helpdesk executes several times an script in powershell used to install licenses for Windows 2008 R2 and then for Windows 2012
The troubleshooting
Reviewing the licenses installed on the system, several entries were found some for Windows 2012 and others for Windows 2008.
We tried the following procedures in order to delete the licenses:
Removing and adding back the RDS role - nothing happened, as soon as the role was installed, the same corrupted database emerged
Rebuilding database - we tried all options... nothing happened
Executing some PS commands - nothing happened
More googling... basically the same commands as in the previous link - nothing happened