Logins and DB Users

  • 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?

  • 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

  • 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[/url]

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • 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?

  • 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

  • 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.

  • This might work. Looks like it's got old sprocs being called in it

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

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply