Hello Nguyễn Hoàng Lâm,
You are encountering a strict, by-design limitation within Windows Server. Microsoft intentionally blocks the Deployment Image Servicing and Management utility from changing an operating system edition while the server is actively hosting the Active Directory Domain Services role. If you attempt the conversion, the system will safely abort the process and return Error 50, indicating that the command is not supported while the role is active. This restriction exists because the Active Directory database, located at C:\Windows\NTDS\ntds.dit, is deeply integrated into the operating system's foundational state. Attempting an in-place license conversion while this database is live risks catastrophic corruption of your domain architecture.
To resolve this and apply your retail key, you must demote the server to a standard member server using Server Manager or the standard uninstallation cmdlets. Once the server reboots and the domain controller restriction is cleared from the system registry and servicing stack, you can safely open an elevated Command Prompt and execute your conversion. You will use the standard syntax DISM /online /Set-Edition:ServerStandard /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula to legally modify the system's servicing state and apply your new key.
After the command completes and the server restarts to finalize the transition to the full retail version, your operating system will be fully activated. You can then safely reinstall the Active Directory Domain Services role and promote the server back to a Domain Controller, fully restoring your network infrastructure without compromising database integrity.
Domic