I'm getting an error trying to add Active Directory Domain Service role to Windows Server 2008 R2
my problem was Remote Registry service with startup type = disable
.
Modified in startup type = automatic
, problem was resolved.
Sometimes you will see this error if you have installed "Active Directory Lightweight Directory Services" before installing the ADDS role. Remove the ADLDS role then install the ADDS role first and reinstall ADLDS.
This is a typical problem with a system package, where an update did not install correctly.
Check your Event Log for a package error when trying to install the role.
There is a tool from Microsoft (updated every month) called System Update Readiness Tool
(SURT). This tool fixes inconsistencies in the Windows servicing store which may prevent the successful installation of future updates, service packs, and software.
You can find the lasted version of the tool here at Microsoft Donwload Center. The tool for Windows Server 2008 R2 for this month (August 2011) is available here.
Reboot the server after the error. Run the tool. Reboot it again. If this doesn't work you can try manually advanced methods for fixing service corruption.
Actually the Remote Registry Service has to do with this problem, please see the below blog for a thorough explanation and ways to resolve:
Active Directory Domain Services and Remote Registry Service