SQL Server Management Studio 2008 通过 VPN 在不同域上运行用户

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5237654/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 09:37:22  来源:igfitidea点击:

SQL Server Management Studio 2008 Runas user on different domain over VPN

sqlsql-server-2008dnsrunaswindows-authentication

提问by maple_shaft

I am currently trying to run SQL Server Management Studio 2008 as a user who is on a different domain. I noticed in other threads that running the following command from a batch script will do this however it doesn't seem to work for me.

我目前正在尝试以不同域中的用户身份运行 SQL Server Management Studio 2008。我注意到在其他线程中从批处理脚本运行以下命令会执行此操作,但它似乎对我不起作用。

runas /netonly /user:DOMAIN\USER "C:\Program Files\Microsoft SQL Server0\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"

I am asked for my password, the Login screen appears however the Windows Authentication username and password are still incorrectly the currently logged in impersonated user on the local Domain. Attempting to connect to the database on the other domain is unsuccessful regardless.

我被要求输入密码,登录屏幕出现,但 Windows 身份验证用户名和密码仍然不正确地是当前登录的本地域上的模拟用户。无论如何,尝试连接到另一个域上的数据库都不会成功。

This seems to work for most people, the kicker for me is that this domain exists over a VPN connection. I am not able to view the VPN domain network computers in My Network Places, and thus I cannot Add Users in Control Panel.

这似乎对大多数人都有效,对我来说最重要的是这个域存在于 VPN 连接上。我无法在网上邻居中查看 VPN 域网络计算机,因此我无法在控制面板中添加用户。

My OS is Vista Business unfortunately, I cannot help this.

不幸的是,我的操作系统是 Vista Business,我无能为力。

Any ideas would be appreciated.

任何想法,将不胜感激。

采纳答案by Ben

Try this:

尝试这个:

NET USE \DBSERVER /USER:DOMAIN\USERNAME

You will be prompted for your password. This establishes a NetBIOS session with the database server. You should be able to see the shared folders and shared printers on the database server once you have done that.

系统将提示您输入密码。这将与数据库服务器建立 NetBIOS 会话。完成此操作后,您应该能够看到数据库服务器上的共享文件夹和共享打印机。

If that works you should be able to connect using SSMS as yourself. You may have to specify "named pipes" as the network protocol to usem, if it doesn't work with TCP (but I think it will).

如果可行,您应该能够像自己一样使用 SSMS 进行连接。如果它不适用于 TCP(但我认为它会),您可能必须指定“命名管道”作为要使用的网络协议。

  • Menu->File->Connect Object Explorer...
  • Options->Connection Properties->Network protocol
  • Specify "Named pipes"
  • 菜单->文件->连接对象资源管理器...
  • 选项->连接属性->网络协议
  • 指定“命名管道”

Named Pipes inherits your existing NetBIOS session, so provided you can list the shares you are probably good to go.

命名管道继承了您现有的 NetBIOS 会话,因此只要您可以列出共享,您就可以使用了。

Update:It looks like in some configurations this does not work with TCP connections, (possibly due to some security update). In these cases you should enable Named Pipes, and set named pipes in your connection string.

更新:看起来在某些配置中这不适用于 TCP 连接(可能是由于某些安全更新)。在这些情况下,您应该启用命名管道,并在连接字符串中设置命名管道。