我刚刚构建了两个新的Win/SQL 2022服务器。一切都很顺利,我可以和SSMS联系。
然后,我将两个SQL engine服务更改为使用域acct (我的标准实践),我可以在本地连接,但不能再通过SSMS进行远程连接,出现以下错误。
The target principal name is incorrect. Cannot generate SSPI context. (Microsoft SQL Server, Error: 0)
当SQL作为本地服务运行时,它可以注册SPN。但是,当它作为一个域运行时,它不能。(我在这两个服务器上重复了几次)。我还尝试使用域管理帐户运行该服务。
我跟踪了自动和手动设置SPN的M.指令。但这两个问题都没有解决。
还有其他人碰到这个吗?如有任何建议或建议,将不胜感激。
编辑:我尝试过Kerberos Config Mgr工具,它不能远程或本地连接,它返回错误:
10/01/2023 11:36:10 am Error: Connect to SQLWMI failed \root\Microsoft\SqlServer\ComputerManagement System.Management.ManagementException: Invalid namespace
我也尝试过运行SQL修复。
SQL日志显示启动后的下列警告:
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.
发布于 2023-01-16 09:27:45
“谢谢你提供的这些细节,”先生发誓。看来是SPN出了问题。我们可能需要为每个Server服务帐户提供4个SPN,以适应不同的Windows身份验证方案。
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”错误。我们可以使用以下命令。
ldifde -r (serviceprincipalname=*) -f allSPN.txt
setspn -D MSSQLSvc/myhost:instancename domain\accoutnname
setspn -L domain\accountname
https://dba.stackexchange.com/questions/321873
复制相似问题