无法使用 SSMS 和 Windows 7 凭据管理器连接到不同域中的 SQL Server
我需要连接到另一个 Windows 域中的 SQL Server 2008 实例来管理它。我们仅使用 Windows 身份验证。
在 Windows XP 中,我可以使用“管理网络密码”功能将远程计算机的用户名和密码存储在本地计算机上。这样做会导致 SQL Server Management Studio 在连接到该服务器时使用这些凭据,而不是我的本地凭据。这非常有效,并且使我每次连接 SSMS 时都不必输入用户名或密码。
但是,天哪,升级到 Windows 7 后,我不能再这样做了。在凭据管理器中添加我的远程域凭据无法产生所需的行为。 SMSS 2008 R2 忽略存储的凭据,而是始终发送我的本地凭据,导致每次登录失败。在 SMSS 中甚至没有办法输入备用凭据,因此结果是我根本无法访问远程服务器!
登录失败并显示以下消息:
登录失败。登录来自 不受信任的域,无法使用 与 Windows 身份验证。 (Microsoft SQL Server,错误:18452)
如何让 SMSS 在 Windows 7 上像在 Windows XP 上一样工作?
I need to connect to a SQL Server 2008 instance in another Windows domain to manage it. We only use Windows Authentication.
In Windows XP, I could use the "Manage Network Passwords" feature to store on my local machine my username and password for the remote machine. Doing so would cause SQL Server Management Studio to use those credentials, instead of my local credentials, when connecting to that server. This worked great, and prevented my having to enter a username or password every time I connected with SSMS.
But, Holy Cow, after upgrading to Windows 7, I can no longer do this. Adding my remote domain credentials in Credential Manager fails to produce the desired behavior. SMSS 2008 R2 ignores the stored credentials, and instead, always sends my local credentials, causing the login to fail every time. There's not even a way, within SMSS, to enter alternate credentials, so the upshot is that I simply cannot access the remote server!
The login fails with the following message:
Login failed. The login is from an
untrusted domain and cannot be used
with Windows authentication.
(Microsoft SQL Server, Error: 18452)
How can I get SMSS on Windows 7 to work the same way it did on Windows XP?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Windows 7 凭据管理器中似乎存在导致此行为的错误。经过大量的互联网研究,我发现了一些丑陋的解决方法,但也发现了一个很好的解决方法:
在凭据管理器中,为远程服务器添加一个条目,但不要只添加服务器名称,如database.contoso.com,而是添加服务器名称与 SQL Server 端口,如下所示:
database.contoso.com:1433
这会产生所需的行为,毫无痛苦!
来源:http://social.msdn.microsoft.com/Forums/en-US/sqlsecurity/thread/c05a90e4-cb16-46f6-9072-37083c65696d/
当然,还要记住,您需要在 Credential Manager 中的远程用户名前加上远程域名作为前缀,如下所示:
database\administrator
It looks like there is a bug in the Windows 7 Credential Manager that causes this behavior. After lots of Internet research, I found some ugly workarounds, but also found a great one:
In Credential Manager, add an entry for the remote server, but instead of adding just the server name, like database.contoso.com, add the server name with the SQL Server port, like so:
database.contoso.com:1433
This results in the desired behavior, with no pain!
Source: http://social.msdn.microsoft.com/Forums/en-US/sqlsecurity/thread/c05a90e4-cb16-46f6-9072-37083c65696d/
Also remember, of course, that you need to prefix the remote username in Credential Manager with the remote domain name, like so:
database\administrator