Apr 292018
Directory Services Restore Mode

Running Veeam Backup and Replication, a Microsoft Windows Server Domain Controller may boot in to safe mode and directory services restore mode.

About a week ago, I loaded up Veeam Backup and Replication in to my test environment. It’s a fantastic product, and it’s working great, however today I had a little bit of an issue with a DC running Windows Server 2016 Server Core.

I woke up to a notification that the backup failed due to a VSS snapshot issue. Now I know that VSS can be a little picky at times, so I decided to restart the guest VM. Upon restarting, she came back up, was pingable, and appeared to be running fine, however the backup kept failing with new errors, the event log was looking very strange on the server, and numerous services that were set to automatic were not starting up.

This specific server was installed using Server Core mode, so it has no GUI and is administered via command prompt over RDP, or via remote management utilities. Once RDP’ing in to the server, I noticed the “Safe Mode” branding on each corner of the display, this was very odd. I restarted the server again, this time manually trying to start Active Directory Services manually via services.msc.

This presented:

Event ID: 16652
Source: Directory-Services-SAM
General Description: The domain controller is booting to directory services restore mode.


Directory Services Restore Mode

The domain controller is booting to directory services restore mode.


This surprised me (and scared me for that matter). I immediately started searching the internet to find out what would have caused this…

To my relief, I read numerous sites that advise that when an active backup is running on a guest VM which is a domain controller, Veeam activates directory services restore mode temporarily, so in the event of a restore, it will boot to this mode automatically. In my case, the switch was not changed back during the backup failure.

Running the following command in a command prompt, verifies that the safeboot switch is set to dsrepair enabled:

bcdedit /v

To disable directory services restore mode, type the following in a command prompt:

bcdedit /deletevalue safeboot

Restart the server and the issue should be resolved!

  41 Responses to “Microsoft Windows Server booting to Safe Mode and Directory Services Restore mode with Veeam Backup”

  1. thx, you saved my life !

  2. You saved my life too…

    thanks for that!

  3. Had this after removing a drive from a server to check it’s SMART status. Later, had this again when restoring from a veeam backup. Thanks for saving the day!!

  4. Thank you for your help! This post saves me and my server 🙂

  5. You Learn Something New every Day..

    Thanks as this was my exact issue encountered 🙂

  6. Thank you very much. I was going to restore the DC before I looked for some more Information, and saw your article which saved me time and trouble.

  7. Thank you very much. You saved me from a stupied mistake I made. I could not understand why it was restarting to safe mode every time after I restored the DC from a backup.

  8. Thanks you save my day …

  9. May the wind be always at your back, my new best friend.

  10. Amazing, add my life to those saved as well 🙂

  11. Saved my bacon too. However, this was on a physical 2016 server.

    Any posts on why this happened?

    I’ve been getting good backups for over a week on this server with no issues.

  12. Nice! Mine was on a 2012r2 VM DC. The Veeam backup failed and while checking for the usual VSS errors I noticed solid ADWS 1202 errors. Restarted and it went into Safe Mode! Great post. Retry backup and all good. Just wonder why it failed to begin with.

  13. You saved my life too some years ago. I came back in 2020 … then i remembered how that post was usefull.

  14. Thank you very much.You saved my weekend! 🙂

  15. thank you very much, it definitely worked

  16. At last 😀 thank you so much.

  17. Just like some others have posted, my issue was on a physical box as well. Thank you

  18. Thanks a lot, saved my day as well! Cheers! 🙂

  19. Hi Zoran,

    Glad it helped!


  20. May you never stub your toe and may there always be fresh air blowing on your balls. You saved yet another life today. Bravo.

  21. Thank you! This worked for me as well.

  22. Thank you, great hint!

  23. Thank you very much. Exactly what I needed.

    Confirmed on Veeam site:

    And their community forum:

  24. OMG, saved my day…. Thank you!

  25. me too same problem same solution….. thx a lot…..

  26. Just saved my bacon, thanks man!

  27. Thanks very much for sharing! I had a similar issue with Server 2012 backed up under Veeam; changing from Selective Startup to Normal Startup would enable Safe Boot with ADR mode enabled. The couple commands above cleared up that behavior and allowed me to select Normal Boot without Safe Boot flipping on as well.

  28. Thanks you very much. Had this issue when A backup failed overnight and the server BSOD and restarted in directory restore mode. Scared the hell out of me before I read this very concise and accurate post.

  29. Thank you, Stephen! This was one of the best “Google the problem” experiences ever. It matched our problem perfectly. Your description was full without being long-winded. The resolution was right on, and it got our domain controller running and backed up very quickly. Blessings!

  30. Yes! Finally after trying a lot of things. Checked the log by way of N-able background console and entered the magic commands and the REBOOT.

    Thanks a lot, you make my day..

  31. As a famous Aussie comic actor once said, “Good one Skippy”

  32. Thanx a lot!! You saved my day 🙂

    I was already seeing me force demoting the faulty DC. I would have never got the idea that Veeam is messing around with the boot options.

    Sure, I had seen the backup job failed because of VSS errors, but what do you do when this error arises? You do a reboot of the problematic VM and presto, the backup runs fine again. This was the first time I had that problem with safe mode.

  33. Hi Oliver,

    Glad the post helped! It’s definitely scary the first time this happens in a production environment when you’re not expecting it!

    Yeah, sometimes VSS can get a bit funky for a number of reasons. The most common one I see is that there are too many VSS snapshots on the VM, which causes a delay or long processing time for VSS when actions happen like backups, which cause it to time out, which can ultimately lead to this problem.

    Check this post out, it’s old but might be relevant: https://www.stephenwagner.com/2012/05/11/server-freezes-while-processing-creating-or-deleting-vss-volume-snapshot-microsoft-windows-server-2008/


  34. Thanx a lot ! Top !

  35. I tried that command and it didnt work – i also couldn’t see the safeboot variable after running the bcdedit command.

  36. Hi Martin,

    Have you verified that your installation is in tact and that there’s no issue? It sounds like you may actually be in a recovery situation, instead of the bug mentioned in this post.


  37. THANKS for the very helpful fix to by 2016 server safemode issue. Save my day 🙂

  38. 2023 and this post still save my life… Thank you soooo much!!!

  39. Saving butts since April 2018 ! Thanks a lot, you saved mine, too.

  40. amazing, still saving asses in 2023!! thx mate

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>