Query Domain For Spn
Setspn l computername q query for existence of spn usage.
Query domain for spn. Register an spn in active directory ad determine the domain user account under which the sql server service is running identify the service account. D delete arbitrary spn usage. Setspn l hostname substitute the actual hostname for the computer for hostname to see the hostname type hostname as a command prompt.
Or a specific user or a specific computer. From a cmd prompt simply run the following command line. After finding the spn records i still wasn t able to fix the double hop issue i was looking into.
Select primarykey dn cn samaccountname samaccounttype serviceprincipalname daterun from spndb. The first query is one to find the spns associated to user objects which will primarily be service accounts if you are using that security model for your instances. Like using setspn to find spns linked to a certain computer.
In command line enter the following command. It ll list the spns. Anyways i stumbled across this tip about how to query ad for all spn records so i thought that i would share it with you.
To check the spns that are registered for a specific computer using that computer you can run the following commands from a command prompt. If the spn is absent for any reason the service must be registered register an spn in active directory ad. Setspn t domain switches and other parameters.
Source credit. This allows you to see if an spn is already out on your domain. Verify spn has been successfully registered using setspn command line utility.