Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Logins and DB Users Expand / Collapse
Author
Message
Posted Thursday, June 27, 2013 8:10 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, June 25, 2014 2:22 PM
Points: 55, Visits: 165
Issue Replication:
1) Create Login for user Domain\ABC
2) User Mapping for user Domain\ABC to Database ABCTest (DB User created in ABCTest database)
3) Remove Domain\ABC username from Login

I am still able to login using Domain\ABC to ABCTEST database and query for records.

Questions
a) Is there a way to delete both Logins and DB User at the same time without having to go through each user databases looking for the username?
b) Anyone know of any scripts that will check DB Users on each database against Logins and output those that does not exists in Logins?
Post #1468174
Posted Thursday, June 27, 2013 8:17 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 9:36 AM
Points: 5,230, Visits: 9,455
If you use the GUI in Management Studio to delete the login, you can go to the User Mapping tab and untick each database that is ticked. This will delete the users from the databases and is quicker than going into each database individually.

John
Post #1468180
Posted Thursday, June 27, 2013 8:29 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 2:02 PM
Points: 7,081, Visits: 12,574
MSSQL_NOOB (6/27/2013)
Issue Replication:
1) Create Login for user Domain\ABC
2) User Mapping for user Domain\ABC to Database ABCTest (DB User created in ABCTest database)
3) Remove Domain\ABC username from Login

I am still able to login using Domain\ABC to ABCTEST database and query for records.

Questions
a) Is there a way to delete both Logins and DB User at the same time without having to go through each user databases looking for the username?

The GUI is a shortcut as John pointed out. Do yourself a favor though, use the Script button and review it before running it in a Query window.

b) Anyone know of any scripts that will check DB Users on each database against Logins and output those that does not exists in Logins?

Loginless In Seattle


__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1468186
Posted Thursday, June 27, 2013 9:36 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, June 25, 2014 2:22 PM
Points: 55, Visits: 165
Thanks for the tip, John.

And OPC, thank you for the link. I was able to run the script on SQL Server 2008. You don't by any chance have a script to check on SQL Server 2000, do you?

Post #1468230
Posted Thursday, June 27, 2013 9:38 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 2:02 PM
Points: 7,081, Visits: 12,574
MSSQL_NOOB (6/27/2013)
Thanks for the tip, John.

And OPC, thank you for the link. I was able to run the script on SQL Server 2008. You don't by any chance have a script to check on SQL Server 2000, do you?


What is SQL 2000?

Sorry, no. My SQL 2000 knowledge fell off the queue a long time ago.


__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1468231
Posted Thursday, June 27, 2013 10:08 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, June 25, 2014 2:22 PM
Points: 55, Visits: 165
No apologies necessary. I totally understand.
Unfortunately, this place I'm currently volunteering is still very heavy on SQL Server 2k.

Nevertheless, thank you very much for your help.
Post #1468245
Posted Thursday, June 27, 2013 10:41 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 4:02 PM
Points: 33,062, Visits: 15,176
This might work. Looks like it's got old sprocs being called in it

http://www.sqlservercentral.com/scripts/Security/63991/








Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1468260
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse