<A Microsoft PFE’s Note from the Field>
So in my day to day SharePoint support endeavors one of theclassic cases that come in from time to time is customers trying to implementKerberos into their Farms. One of theissues I see pop up a lot is duplicate SPN’s.
The classic method (via the command line) is to run thefollowing command to create an SPN:
Setspn –a http/<FQDN or Netbios Name> Domain\usercredential
For example Setspn –ahttp/connect.sharepoint.comsharepoint\content1
This would create an SPN to be used to create a validKerberos ticket for the http/connect.sharepoint.com site. Easy stuff here and you can verify this by going into ADSIEdit and openthe properties for the Content1 Service Name.
But how do we get the issue with Duplicate SPN’s. Usually this comes down to poor planningbefore you turn on your computer. Sayas an example (and one I see often) you didn’t think this through and plan yourAuthN properly. Or say you just made asimple “FatFinger” or had a “Brain Cramp”… it happens. For illustration purposes lets go with theidea that you created the above mentioned SPN but for some reason you tried torun the Setspn command again using a different account. Voila! that’s where we are in trouble. In my example I created two SPN entriespointing to the same site but I used two different service accounts. SPContent and SPContent1. As you can see in the screenshot below I getan Event ID 11 thrown which if you can read the text is basically telling meexactly what I need to know to go forward and fix the issue.
So is there a way to verify this before I go and run thecommand? Absolutly. If you enter the command Setspn –x you willget a list of any duplicates that exist in your environment.
Let’s take this one step further and combineboth the –A and the –X into a single FatFinger Proof method of creating our SPN’s
Operation ABORTED!!! So if we look at the above output were shown the same information as theSetspn –x but we are also combining this with the ability to add an SPN. In both of these outputs you can clearly seethat in my demonstration I tried to create an SPN for the same sitehttp/connect.sharepoint.com but I used separate accounts. Also note that I can use the same accountfor multiple hosts if I so choose.. in this case im using Spcontent1 for bothhttp/connect and http/my.
So in a perfect world when you are doing this work and you don’thave any duplicates you can use either the setspn –x initially to see if anyduplicates exist or do what I always do… use the setspn –s and cover everythingin one sweep. In the above example ifthere were no duplicates the process would successfully finish and presto changoyou have your SPNs created
Hope this helps someone out there J Cheers!