September 11, 2008 at 5:12 pm
The Gurus,
I need help with a script that could pick a username and create a login for it in SQL Server. I have about 300 usernames to create logins for and I think it will be tedious doing them one after the other. Also, I want the same script or another to be able to map a username with a specific database.
The whole scenario is like this. I have an application (with SQL Server back end) that creates a storage area (database) in SQL Server. I now need a script that will be able to take a username from the active directory and create a SQL Server login for that username as well as mapping that username with a specific database. I want each user to have access to a database each.
I will so much appreciate it if someone could give me a script that could do this.
Many thanks.
Sahoong.
September 12, 2008 at 1:45 am
Hi
Before answering your post could you please giver reply to these
How can u taking username from active dir?
How to find the all the username from sql server?
How to grant more than one permission more than one user?
September 12, 2008 at 2:54 am
If all 300 of those logins are AD, then why do you want 300 matching SQL logins?
Add those logins to a domain group, grant the domain group login rights on SQL and map that group to the DB. Single login, minimal admin work.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply