使用Windows身份验证和特定的帐户连接到SQL Server [英] Connect to SQL Server using windows authentication and specific account

查看:500
本文介绍了使用Windows身份验证和特定的帐户连接到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.Net应用程序,运行使用Windows身份验证。到SQL Server的连接通常是通过创建一个SQL Server的帐户,并使用该连接字符串中完成的。

I have an ASP.Net app, that runs using windows authentication. The connection to the SQL Server is usually done by creating a sql server account and using that in the connection string.

然而,在这种特定的非常严格的托管环境中,我们被要求使用特定的Windows / Active Directory帐户连接到SQL Server。

However, in this specific very restrictive hosting environment, we have been asked to use a specific WINDOWS/active directory account to connect to the SQL Server.

请注意这不是该网站的用户的Windows凭据,我们需要与连接到SQL服务器 - 这是一个特定的窗口/ AD帐户

Please note it is not the windows credentials of the user of the website, we need to connect to the SQL server with - it is one specific windows/AD account.

我如何配置我的连接字符串?

How do I configure that in my connection-string?

推荐答案

使用一个ConnectionString的是这样的:

Use a connectionstring like this:

Server=YourServer; Database=YourDatabase; Integrated Security=true;

您的节目就到,你需要连接的帐户下运行。您可以通过编辑程序池设置在IIS网站的身份。

Your program has to run under the account that you need to connect as. You can set the identity of your website in IIS by editing the AppPool.

这篇关于使用Windows身份验证和特定的帐户连接到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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