VB.net - Active Directory 连接字符串 [英] VB.net - Active Directory Connection String

查看:24
本文介绍了VB.net - Active Directory 连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个问题,我似乎无法弄清楚.我需要一个连接字符串以允许程序使用 Active Directory 帐户连接到 SQL Server.

So I have a problem, I can't seem to figure out. I need a connection string to allow the program to connect to the SQL Server using an Active Directory Account.

但是,Active Directory 帐户与登录的用户帐户不同,因为我们不想让用户只能访问 SQL 程序...如何配置连接字符串以使用程序AD 帐户而不是用户 AD 帐户?

However, the Active Directory account is different from the users logged in account, because we don't want to allow the user to have access to SQL just the program...how can I configure the Connection String to use the programs AD account and not the users AD Account?

推荐答案

如果您想为您的程序使用专用服务帐户,您需要使用 SQL(混合)登录而不是集成登录.

You need to use SQL (mixed) login rather than integrated login if you want to use a dedicated service account for your program.

无法使用来自与运行当前进程的帐户不同的 Active Directory 帐户的凭据连接到 Sql Server.在进行集成的 Active Directory 身份验证时,Sql Server 仅使用域颁发的令牌.它甚至永远不会看到密码,因此您无法编写用于登录的连接字符串.

There is no way to connect to Sql Server using the credentials from an Active Directory account different than the account running the current process. When doing integrated Active Directory authentication, Sql Server only uses the token issued by the domain. It never even sees the password, therefore there is no connection string you can write that will do that login.

最接近的是在 Windows 中设置一个计划任务,该任务以您所需的用户帐户运行您的应用程序.然后您可以授予其他帐户访问权限以启动任务.

The closest you can get is to setup a Scheduled Task in Windows that runs your application as your desired user account. Then you can give other account access to start the task.

这篇关于VB.net - Active Directory 连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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