A few years ago  I wrote about how you could enable Domain Accounts to self-manage their ServicePrincipalNames. This is particularly advantageous when using Kerberos to secure services.
We recently needed to set up some service accounts in Active Directory to participate in establishing a Kerberos capability for middleware integration. I began unpacking the ADSIEdit approach, but stopped. Whilst you can reach your end goal using the “established” approaches, it’s an absolute pain to deploy these changes to other environments. Surely there must be a better way?
Enter PowerShell. We can automate (by scripting) the ability to grant Active Directory accounts the ability to read and write ServicePrincipalName. Eureka! Full credit goes to this excellent answer on StackOverflow .
Now, you’d invoke this function this way: