要使用 Kerberos 身份验证,某种服务必须注册其名称(称为服务主体名称 (SPN)),以及运行该服务所使用的账户。默认状况下,Active Directory® 目录服务注册 NetBIOS 或者计算机名,并容许计算机账户使用 Kerberos。若是要以不一样账户或使用不一样名称(例如,若是计算机使用其余的 WINS 或 DNS 名)运行服务,那么您能够使用 Setspn.exe 命令行工具设置 SPN。要设置 SPN,您必须是域管理员。
Setspn.exe 命令行实用程序能够在 Windows Server 2003 CD-ROM 内的支持工具包中得到。在window2003中能够运行support tools中的suptools.msi来安装。ide
下面是使用 Setspn.exe 命令行实用程序的基本语法,其中“accountname”能够是单独的名称,也能够是域\名称。
setspn [parameter] accountname工具
Setspn.exe 能够使用下列参数:spa
参数
功能
示例.net
-R
重置 HOSTServicePrincipalName 。
setspn -R computername命令行
-A
添加任意的 SPN。
setspn -A SPN computernameserver
-D
删除任意的 SPN。
setspn -D SPN computernameblog
-L
列出已注册的 SPN。
setspn -L SPN computernameip
下面的示例使用 Setspn.exe 命令行实用程序注册以 Domain\UserAccount 运行的应用程序池:ci
SETSPN.EXE -A HOST/ Domain\UserAccount
下面的示例注册 SPN“HOST/daserver1”和“HOST/{DNS of daserver1}”:get
setspn -R daserver1
下面的示例为计算机“daserver1”注册 SPN“http/daserver”:
setspn -A http/daserver daserver1
下面的示例从计算机“daserver1”删除 SPN“http/daserver”:
setspn -D http/daserver daserver1
官方参考http://support.microsoft.com/kb/970536/
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/wzhwho/archive/2011/01/30/6169624.aspx