简体   繁体   English

从作为服务启动的应用程序中使用Windows身份验证连接到SQL Server

[英]Connection to SQL Server using Windows Authentication from an application started as service

MSSQL server is running with Windows and SQL Server Authentication mode on a server called 'HOST1'. MSSQL服务器在名为“ HOST1”的服务器上以Windows和SQL Server身份验证模式运行。 The application which needs to connect with the SQL Server is started as a service on a server called 'HOST2'. 需要与SQL Server连接的应用程序作为服务在称为“ HOST2”的服务器上启动。 Since the service manager starts applications as the user "NT Authority\\System", I'm unable to connect with the SQL Server on 'HOST1' from 'HOST2'. 由于服务管理器以“ NT Authority \\ System”用户身份启动应用程序,因此无法从“ HOST2”与“ HOST1”上的SQL Server连接。

I have the option of manually changing the user account using which the services are launched. 我可以选择手动更改用于启动服务的用户帐户。 That is, 那是,

Right click service -> properties -> Log On -> Choose 'This Account' -> Provide a user which has permission to connect with SQL Server in 'HOST1'

But the problem is, there will be hundreds of services, running in hundreds of hosts. 但是问题是,将有数百个服务在数百个主机中运行。 Hence modifying the user manually for all services is not possible in my case. 因此,在我的情况下,无法为所有服务手动修改用户。

Please let me know how I can connect to SQL Server. 请让我知道如何连接到SQL Server。

Would using Powershell to script out a solution that is not quite as taxing? 是否会使用Powershell编写出不太费力的解决方案? Maybe as part of the deploy process? 也许是部署过程的一部分?

Powershell script to change service account Powershell脚本来更改服务帐户

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Wildfly中将Windows身份验证用作服务的SQL Server - SQL Server using Windows Authentication in Wildfly as service 使用服务的SQL Server Windows身份验证 - SQL Server Windows Authentication using a Service 尝试使用繁琐的连接和 Windows 身份验证连接到 SQL 服务器? - Trying to connect to SQL server using Tedious Connection and Windows Authentication? 无法通过Windows身份验证使用连接字符串连接到SQL Server - Unable to connect to SQL Server using a connection string with Windows authentication SQL Server 2000安装-将可信连接与Windows身份验证一起使用 - SQL Server 2000 install - Using Trusted Connection with Windows Authentication 使用Windows身份验证的SAS连接到SQL Server DB - SAS connection to SQL Server DB using Windows Authentication 使用Windows身份验证连接到本地SQL Server数据库的连接字符串 - Connection string to connect to a local SQL Server database using windows authentication 如何将 SQL 连接字符串从服务器更改为 Windows 身份验证 - How to change SQL Connection string from server to Windows authentication 将连接字符串从SQL Server更改为Windows身份验证 - Changing connection string from SQL Server to windows authentication 通过具有Windows身份验证的odbc连接从PHP连接到SQL Server - Connect to SQL server from PHP via odbc connection with Windows authentication
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM