在 SQL Server Management Studio(2005 或更高版本)中连接不同的 Windows 用户 [英] Connect different Windows User in SQL Server Management Studio (2005 or later)

查看:29
本文介绍了在 SQL Server Management Studio(2005 或更高版本)中连接不同的 Windows 用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 SQL Server Management Studio 2005(或更高版本)中有没有办法更改 Windows 身份验证用户(就像在 SQL Server 2000 及更早版本中一样)?

Is there a way in SQL Server Management Studio 2005 (or later) to change the Windows Authentication user (as you could in SQL Server 2000 and older)?

这是一般的连接属性对话框(注意选择 Windows Auth 时显示为灰色的 UID/PWD):

This is the general connection properties dialog(note the greyed out UID/PWD when selecting Windows Auth):

仅供参考 - 一种解决方法是使用 runas 但我正在寻找一种解决方案,该解决方案将允许我跨多个服务器(以及跨多个域)使用多个 Windows 帐户.

FYI - One workaround is to use runas but I'm looking for a solution that will allow me to work with multiple Windows accounts across multiple servers (and across multiple domains).

推荐答案

虽然无法在单个 SSMS 实例中以不同用户的身份连接到多个服务器,但您需要的是以下 RUNAS 语法:

While there's no way to connect to multiple servers as different users in a single instance of SSMS, what you're looking for is the following RUNAS syntax:

runas /netonly /user:domain\username program.exe

当您使用/netonly"开关时,即使没有设置信任,您也可以使用远程凭据登录您当前不是其成员的域.它只是告诉 runas 凭据将用于访问远程资源 - 应用程序以当前登录的用户身份与本地计算机交互,并以您提供凭据的用户身份与远程计算机交互.

When you use the "/netonly" switch, you can log in using remote credentials on a domain that you're not currently a member of, even if there's no trust set up. It just tells runas that the credentials will be used for accessing remote resources - the application interacts with the local computer as the currently logged-in user, and interacts with remote computers as the user whose credentials you've given.

您仍然需要运行多个 SSMS 实例,但至少您可以在每个实例中以不同的 Windows 用户身份进行连接.<小时>例如:runas/netonly/user:domain\username ssms.exe

You'd still have to run multiple instances of SSMS, but at least you could connect as different windows users in each one.


For example: runas /netonly /user:domain\username ssms.exe

这篇关于在 SQL Server Management Studio(2005 或更高版本)中连接不同的 Windows 用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆