23 responses

  1. Tony
    2018-02-22

    Really good post!

    I´ve noticed aswell the services wont startup sometimes and i added a delay of SQL services as a workaround but this is much better solution.

    Thanks for your effort 🙂

    Reply

  2. Ghislain
    2018-02-22

    Worked like a charm !
    thank you

    Reply

    • Ghislain
      2018-02-22

      Weird this I had only the issue on one server

      Reply

    • Wayne Sheffield
      2018-02-22

      I’m glad that it worked for you. I hope that others find this post useful as well.

      Reply

  3. MatthiasB
    2018-03-02

    Great post!
    Just a comment regarding service dependencies: Instead of using Regedit you can also use the “sc” command from an elevated command shell to create servive dependencies like this:

    “sc config ServiceA depend= ServiceB”

    Reply

    • Wayne Sheffield
      2018-03-02

      Ahh, this is good. It is wise to avoid changing the registry directly whenever possible. Thanks!

      Reply

      • cmcapellan
        2018-05-06

        To add to the comment above, the exact command you want to use here is:

        sc config mssqlserver depend=w32time/netlogon

        Needs to be a one liner because you have to specify both services at once…

        Reply

      • Wayne Sheffield
        2018-05-07

        Thanks! I can see people trying to do this one service at a time.

        Reply

  4. Ian Vaughan
    2018-07-05
  5. GoldGnomeCotton
    2018-08-11

    Thanks for the tip, but I can’t get it to work. After adding the W32Time and Netlogon to the dependencies in the Registry Editor, I go the the MSSQLSERVER service properties and no dependencies are shown. The KEYISO is not there either.

    For context, I’m working in a virtual environment with one Domain Controller and two SQL Server member servers. I’ve successfully set up a gMSA, but SQL Server refuses to start automatically on startup on both of the members. The SQL Servers will work if I manually start them.

    Thoughts?

    Reply

    • Wayne Sheffield
      2018-08-13

      Are you opening up Registry Editor in Administrator mode? Are you using an account that is in the local administrator’s group?
      Also, see the note from cmcapellan above about using the SC utility to set these dependencies with:
      sc config mssqlserver depend=w32time/netlogon

      Reply

      • Brett O’Connor
        2018-08-20

        No I wasn’t. I took both of those suggestions and it appears to be working now. Thanks for the reply and the tip!

        Reply

  6. John Zabroski
    2018-08-17

    Wayne, what SQL Server version are you using? I am using an AWS SQL Server Std Edition on Windows Server 2016 Datacenter 10.0 x64 Build 14393 (Hypervisor).

    Also, I believe keyiso is only automatically added to DependsOn iff you use cryptography features like cryptographically signed certificates to protect things like data and code. I believe you should update your post to spell out these nuances.

    Reply

    • Wayne Sheffield
      2018-08-17

      Hi John,
      A gMSA can be used with SQL Server 2014+. This article was based off of SQL Server 2016 and 2017.

      About KeyISO: SQL Server uses certificates, so it needs this service. In my experience, I’ve always seen KeyISO being a dependent service for SQL Server.

      Reply

  7. Michael
    2019-04-04

    Hello,

    I also ran in the problem when my SQL Service did not start after reboot using managed service accounts.

    I solved the problem when I modified the following registry value (maybe the key difffers according to your instance name or the key might be missing entirely):

    Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLSERVER
    Value: ServiceAccountManaged
    Datatype: REG_BINARY

    On one working machine the content of this key was
    01 00 00 00

    The other machine which was NOT working had its value set to
    00 00 00 00

    Note: You have to reboot your OS after you modified the registry value.

    I don’t know why this happened, but I tried several reboots and every time the SQL Server Service starts fine even without configuring any service dependencies.

    Hope this helps!

    Kind Regards,
    Michael

    Reply

    • Wayne Sheffield
      2019-04-23

      Thanks Michael. The next time that I run into this, I’ll be sure to check this out.

      Reply

  8. John Zabroski
    2019-04-23

    I wonder if the behavior Michael sees is due to the good server being configured solely through SQL Server Configuration Manager. See this: //blogs.msdn.microsoft.com/markweberblog/2016/05/25/group-managed-service-accounts-gmsa-and-sql-server-2016/

    Reply

  9. sqlrnnr
    2020-01-16

    Fwiw – I am seeing some of the same behavior Michael has seen regardless of the services being configured via SCCM or even if the gmsa was added during SQL Server setup. It seems random as to when that ServiceAccountManaged is not set.

    Reply

  10. Ashley Williams
    2020-01-17

    We had the same issue on a CRM SQL server. Couldn’t get the gMSA account to stick after a reboot for SQL Server, Reporting Services or SQL Server Agent. Everything we tried would not allow the account to start until we blanked out the password.

    Finally changed the registry entry mentioned above by Michael:

    Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLSERVER
    Value: ServiceAccountManaged
    Datatype: REG_BINARY

    01 00 00 00

    Added this also for Reporting server and SQL Server Agent services in the registry.
    Everything started on reboot after that.

    Reply

  11. agw
    2020-01-17

    We have a CRM SQL Server using a gMSA account that wouldn’t start SQL server on reboot no matter what we did. I had to keep blanking out the password to get services to start.

    Finally was able to get it working on reboot by applying Michael’s suggestion from above:

    Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLSERVER
    Value: ServiceAccountManaged
    Datatype: REG_BINARY

    01 00 00 00

    Had to do this to Reporting Services and SQL Server Agent as well to get them to start.

    Reply

  12. Michael Mertens
    2023-04-05

    Great, thank you so much. I just added Dependencies and Reg-Key ServiceAccountManaged in a SQL 2022 installation in an Azure VM. Everything works now. Interesting: I have several instances on the server. There were ones with “ServiceAccountManaged” missing, some with value 1, some with value 0. (don’t know why they are different; I added all gmsas at the same time)
    Missing and 1 worked, 0 didn’t.

    Reply

Leave a Reply to let me know how you liked this post

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top
mobile desktop