Unable to edit Service Principal Name for certain users.

Moshiur (Moshiur Khan) 80 Reputation points
2023-12-17T04:53:54.85+00:00

To avoid a kerberoasting issue, a client made a request to identify the users and take the necessary actions.
Removing the Service Principal Name seems to be the solution, but I have been unsuccessful in removing the SPN using the normal means.

The normal means:

  1. Through Attribute Editor:
    find the users (Sqlsvcadmin, -client created adminuser-) in their respective OUs, open properties, go to attribute editor and edit.
    Result: No edit option. SPN seems to be view only.
  2. Through powershell:

Ran this code with admin privileges:

Set-ADUser -Identity sqlsvc.admin -ServicePrincipalNames @{Remove='MSSQLSvc/servername.domainname.local:1433'}

Result: an error showing the current user account does not have the required privilege.

Some things to note:
The user account used for the above scenarios is a domain admin with the schema admin and enterprise admin role. Verified the account is able to edit spn just fine.
The user account sqlsvcadmin mentioned to be edited is a service account and are a part of the domain admin group. The client created admin user shared the same spn but we are unable to remove it from that user either.

After my research I've come to the conclusion that it must be a service dependency that is denying the modification of the SPN.
I would like some insight and possible solutions to this issue.

-Cheers

Moshiur

Windows for business | Windows Client for IT Pros | Directory services | Active Directory
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Thameur-BOURBITA 36,261 Reputation points Moderator
    2023-12-17T22:59:44.17+00:00

    Hi @Moshiur (Moshiur Khan)

    Do you have the same error when you use the command setspn :

    setspn -d MSSQLSvc/servername.domainname.local:1433 sqlsvc.admin
    

    Please don't forget to accept helpful answer


  2. Anonymous
    2023-12-18T06:00:26.5866667+00:00

    Hello
    Moshiur (Moshiur Khan)
    ,

    Thank you for posting in Q&A forum.

    You can give the permissions to the domain admin and check the result.

    Right click the user you want to remove/delete the SPN from.

    And select Properties and Security tab.

    Check if the domain admin has permissions

    Read ServicePrincipleName

    Write ServicePrincipleName

    Or

    Read msDS-PrincilpeName
    Read msDS-PrincilpeName

    If no, you can try to give him/her permissions above.

    If it odes not work, you can give him/her permissions below.

    read all properties
    write all properties

    Hope the information above is helpful.

    If you have any question or concern, please feel free to let us know.

    Best Regards,
    Daisy Zhou


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.