I'm trying to restrict access to a database on my server to only allow users from a specific Windows group.
I have enabled Windows authentication for the server, but it seems as if I can only allow access to specific users, not specific groups...
Is there any way I can do this?
Most of the resources I've found contain SQL Server 2005
specific instructions, and I have thus far been unable to translate them开发者_运维百科 over to 2008
.
Do the following:
In the New user Dialog click the Search button
.
Then click Object Types
.
Select Groups
, deselect Users
and Built-in Security Principals
Click Ok
.
Then click on Find Now
At this point you should see a list of groups available.
Pick the one you want and click OK
.
Assign rights as necessary.
SQL Server 2005 and 2008 are essentially the same here.
USE master
CREATE LOGIN [domain\group] FROM WINDOWS
GRANT CONNECT SQL TO [domain\group]
USE MyDB
CREATE USER [domain\group] FROM LOGIN [domain\group]
GRANT CONNECT TO [domain\group]
This will allow everyone in the windows group to connect to your database. Is that what you want?
Or do you want to deny some folk access, which I thought at first...
精彩评论