Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 How i can use / add AD user to SQL

Author  Topic 

behnam
Starting Member

2 Posts

Posted - 2011-11-06 : 07:04:43

Dear all
i want to limit user to database , i have many database & many user, i have Domain , Active Directory(AD) , windows 2003 Enterprise R2,
SQL server 2005 Enterprise
i want to use AD user with SQL,
for example :
user: "bps@shaar.local"
when add user "bps" assign(user mapping) some Database to this user & server roles have public & sysadmin check box & in status= permission to connect to database engine: is Grant / login: is Enabled
please find picture of error in top of txt

please help me how can i use domain user with domain password with AD
i want login to SQL with AD user & AD password

Sachin.Nand

2937 Posts

Posted - 2011-11-06 : 08:16:29
The image is not visible to me.

To create a login from your AD run this

Create Login YourADUSER from Windows

And then select the database where you want to add a user mapped to that login

Create a user UserName from Login YourADUSER


Then use sp_addrolemember to add the user to a specific role

sp_addrolemember 'db_ddladmin','UserName '


PBUH

Go to Top of Page

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2011-11-06 : 10:18:01
Also, it looks like you are trying to use a local windows account (local to that system). You don't want to do that, you want to use the domain login.

CREATE LOGIN [shaar\bps] FROM WINDOWS;
GO

USE {database} -- change this to the right database
GO

CREATE USER [shaar\bps] FROM LOGIN [shaar\bps];
GO

Then, add the user to the appropriate roles.

Jeff
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2011-11-06 : 10:27:03
@jeff

I am trying to understand how your answer is different then mine..

PBUH

Go to Top of Page

behnam
Starting Member

2 Posts

Posted - 2011-11-06 : 13:30:05
thansk for all
some of my user use remotly frome out site & some another user use in local domain
i w to login with e Sql Server Authentication login method
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2011-11-06 : 13:33:35
So whats the issue ?

Just create a login with sql authentication.

Creat login yourusername with password=yourpassword

PBUH

Go to Top of Page
   

- Advertisement -