There are various reasons that you may need to search for an alias. Maybe you want to find which service account an SPN is added to, or if any SPNs have been created. You can do this by using the setspn command and adding the -Q switch . For example, if you want to find all SPNs with the string "davey" in them you would type:
setspn -Q */*davey*
Note that the format of the string needs to be in the format of a SPN. In other words a forward slash is required. The text before the slash is the Service Class and the text after is the host, port and service name. You can then use the "*" character as a wildcard in the rest of the string.
As an example, if you want to search for all SQL Server SPNs with "davey" in them you could use the following:
setspn -Q MSSQLSvc/*davey*
If you are adding a new SPN remember to use the -S switch as that will search and verify the SPN doesn't already exist.
No comments:
Post a Comment