首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >新的SQL 2022服务器不会注册SPN

新的SQL 2022服务器不会注册SPN
EN

Database Administration用户
提问于 2023-01-09 03:08:49
回答 1查看 831关注 0票数 0

我刚刚构建了两个新的Win/SQL 2022服务器。一切都很顺利,我可以和SSMS联系。

然后,我将两个SQL engine服务更改为使用域acct (我的标准实践),我可以在本地连接,但不能再通过SSMS进行远程连接,出现以下错误。

代码语言:javascript
运行
复制
The target principal name is incorrect.  Cannot generate SSPI context. (Microsoft SQL Server, Error: 0)

当SQL作为本地服务运行时,它可以注册SPN。但是,当它作为一个域运行时,它不能。(我在这两个服务器上重复了几次)。我还尝试使用域管理帐户运行该服务。

我跟踪了自动和手动设置SPN的M.指令。但这两个问题都没有解决。

还有其他人碰到这个吗?如有任何建议或建议,将不胜感激。

编辑:我尝试过Kerberos Config Mgr工具,它不能远程或本地连接,它返回错误:

代码语言:javascript
运行
复制
10/01/2023 11:36:10 am Error: Connect to SQLWMI failed \root\Microsoft\SqlServer\ComputerManagement System.Management.ManagementException: Invalid namespace

我也尝试过运行SQL修复。

SQL日志显示启动后的下列警告:

代码语言:javascript
运行
复制
SQL Server is attempting to register a Service Principal Name (SPN) for the SQL Server service. Kerberos authentication will not be possible until a SPN is registered for the SQL Server service. This is an informational message. No user action is required.

The SQL Server Network Interface library could not register the Service Principal Name (SPN) [ MSSQLSvc/server.domain ] for the SQL Server service. Windows return code: 0xffffffff, state: 53. Failure to register a SPN might cause integrated authentication to use NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies and if the SPN has not been manually registered.
EN

回答 1

Database Administration用户

回答已采纳

发布于 2023-01-16 09:27:45

“谢谢你提供的这些细节,”先生发誓。看来是SPN出了问题。我们可能需要为每个Server服务帐户提供4个SPN,以适应不同的Windows身份验证方案。

代码语言:javascript
运行
复制
setspn -S MSSQLSvc/myhost.redmond.microsoft.com:instancename domain\accountname  
setspn -S MSSQLSvc/myhost.redmond.microsoft.com:1433 domain\accountname  
setspn -S MSSQLSvc/myhost:instancename domain\accountname  
setspn -S MSSQLSvc/myhost:1433 domain\accountname

万一上面的命令抛出“重复SPN”错误。我们可以使用以下命令。

  1. 为DC征集所有SPN。要查找重复项,可以搜索确切的SPN条目,以查找它在哪个用户下运行。
代码语言:javascript
运行
复制
ldifde -r (serviceprincipalname=*) -f allSPN.txt
  1. 删除特定的SPN
代码语言:javascript
运行
复制
setspn -D MSSQLSvc/myhost:instancename domain\accoutnname
  1. 验证SPN。
代码语言:javascript
运行
复制
setspn -L domain\accountname
票数 1
EN
页面原文内容由Database Administration提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://dba.stackexchange.com/questions/321873

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档