‘The directory service is busy’ error when renaming a domain computer

This one was a new one… and a bugger to track down!  While renaming domain computers, several of the rename operations would encounter an error during the rename process of

The following error occurred attempting to rename the computer to [New Name]:
The directory service is busy.

image

Well, if you have SQLExpress or SQLServer installed, the error may be leading you down the wrong path.  In our particular case, the error was a security error related to SQLExpress / SQLServer SPNs (Service Principal Name).  Basically, the rename operation could not rename the SPNs.

How to identify a potential SPN issues

  1. Open a CMD prompt as an administrator
  2. enter the command:
    setspn –L [Computer Name]
  3. Check for *any* registered SPN which is in the format of
    MSSQLSvc/[Computer Name]:[Instance Name]

In short, if you have *any* SPN which starts with MSSQLSvc, you will not be able to rename your computer!

How to fix SPN issues

  1. For *each* identified SPN above, you must delete the SPN using the following command:
    setspn –d [SPN Name] [ComputerName]
    Important: You must use the full SPN name as identified via the setspn –L command.  These will be in the format of MSSQLSvc/Computer.domain.tld:instance

That is it!  You can now rename your computer!

16 thoughts on “‘The directory service is busy’ error when renaming a domain computer

  1. Marty

    Your suggestion did not work for me. Is there something incorrect with my syntax? Thanks.

    C:\WINDOWS\system32>setspn -d MSSQLSvc/IHBI-Z220-62682.qut.edu.au:QSRNVIVO10 IHBI-Z220-62682
    Unknown parameter MSSQLSvc/IHBI-Z220-62682.qut.edu.au:QSRNVIVO10. Please check your usage.

  2. ArmgaSys Post author

    Marty,

    At first glance, it looks like you may have a space in the SPN name (I.E. the QSRNVIVO10 IHBI-Z220-62682 looks like there is a space between the 0 and the I).
    If the name really does contain a space, put the entire name in quotes.

    setspn -d “MSSQLSvc/IHBI-Z220-62682.qut.edu.au:QSRNVIVO10 IHBI-Z220-62682”

  3. Adam

    Any idea *why* this happens and why this solution works? I have the same problem, but am having trouble finding a solution. Also, I’ve seen workstations with the SPN entry but can still be renamed. However, those particular machines had another entry that looked like “MSSQLSvc/[Computer Name]”.

  4. Fauzul

    Great tutorial! Finally found something that works concerning this issue. Now I don’t need to go and format the PC that I am working on.

  5. sanad

    it gaves me this error

    FindDomainForAccount: Call to DsGetDcNameWithAccountW failed with return value 0x00000525
    Unable to locate account SQLEXPRESS

    noted that im using windows server 2016 and AD 2012 r2

  6. Tarvinder Singh

    great stuff. I found this error on an azure windows vm which didnt had sql installed. But still I got this error while I was simply trying to join the computer to domain.(domain join command Add-computer has NewName parameter also to specify during the domain join porcess.

Leave a Reply

Your email address will not be published. Required fields are marked *