I have a .net application which is connecting to the SQL Server using windows authentication.
We cannot use SQL Server authentication in the application. We have lot of Active Directory users there for our project. So we have to create separate login account for each Active Directory users in SQL Server rather than creating separate login account for each AD users, is there any way to use the active directory user group in SQL Server?
You can use T-SQL:
I use this as a part of restore from production server to testing machine:
You will need to use localized name of services in case of German or French Windows, see How to create a SQL Server login for a service account on a non-English Windows?
In SQL Server Management Studio, go to
Object Explorer > (your server) > Security > Logins
and right-clickNew Login
:Then in the dialog box that pops up, pick the types of objects you want to see (
Groups
is disabled by default - check it!) and pick the location where you want to look for your objects (e.g. useEntire Directory
) and then find your AD group.You now have a regular SQL Server Login - just like when you create one for a single AD user. Give that new login the permissions on the databases it needs, and off you go!
Any member of that AD group can now login to SQL Server and use your database.