Question: how to restore active directory domain services database in windows server 2012 r2?
Answer: Open a command prompt using the blue PowerShell icon on the desktop taskbar, or from the Start screen.
In the PowerShell console window, type bcdedit /set safeboot dsrepair and press Enter.