如何在 Windows 域中获取 SQL Server 的 Windows 身份验证使用帐户?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5088712/
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-15 16:14:48  来源:igfitidea点击:

How to get SQL Server's Windows Authentication use accounts in a Windows Domain?

windowssql-server-2008authenticationactive-directory

提问by Nam G VU

Let's say in the office the staff are all using Active Directoryfor authentication when accessing shared folder, remote control, ect. Now we need to use this same manner to log in SQL Server 2008 but not sure where to get started.

假设在办公室,员工Active Directory在访问共享文件夹、远程控制等时都使用身份验证。现在我们需要使用相同的方式登录 SQL Server 2008 但不确定从哪里开始。

Please help if you know how to. Thank you! Nam.

如果你知道怎么做,请帮忙。谢谢!南。

回答by Sachin Shanbhag

If you are asking through SQL management studio, then on login screen you have a combobox saying what kind of authentication type you want to use. You need to use "Windows Authentication" option

如果您是通过 SQL management studio 询问,那么在登录屏幕上,您会看到一个组合框,说明您要使用哪种身份验证类型。您需要使用“ Windows Authentication”选项

If you are talking about connection string, then you need to add Integrated Security=true;in your connection string instead of username and password.

如果您在谈论连接字符串,那么您需要添加Integrated Security=true;连接字符串而不是用户名和密码。

回答by Matthew Burr

Before users can log in to the SQL Server via Windows Authentication, you will need to be sure that you have granted their Windows accounts access to the SQL Server. Methods for doing this via SQL Server Management Studio and Transact-SQL are documented in Books Online here: http://msdn.microsoft.com/en-us/library/aa337562.aspx.

在用户可以通过 Windows 身份验证登录 SQL Server 之前,您需要确保您已授予他们的 Windows 帐户访问 SQL Server 的权限。通过 SQL Server Management Studio 和 Transact-SQL 执行此操作的方法记录在此处的联机丛书中:http: //msdn.microsoft.com/en-us/library/aa337562.aspx

After you've done this, then - as Sachin indicated in a separate answer - you and your users will need to indicate that they want to log in using Windows Authentication; Sachin has provided instructions for doing so.

完成此操作后,正如 Sachin 在单独的回答中指出的那样,您和您的用户需要表明他们想要使用 Windows 身份验证登录;Sachin 提供了这样做的说明。