Re: getting logins and users for all server in the enterprise

From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 06/29/04

  • Next message: Joachim Hofmann: "Change NT Domain Name with SQL Servers in"
    Date: Tue, 29 Jun 2004 21:28:45 +0530
    
    

    Hi,

    You can write a small batch file and redirect the output to a file.

    OSQL -Usa -Ppassword -Sservername -d master -Q"select name from syslogins"
    >c:\users\logins.txt
    OSQL -Usa -Ppassword -Sservername -d master -Q"select name from syslogins"
    >>c:\users\logins.txt
    OSQL -Usa -Ppassword -Sservername -d master -Q"select name from syslogins"
    >>c:\users\logins.txt

    Do the same for all servers.

    If you need all the logins and the database users associated then:-

    OSQL -Usa -Ppassword -Sservername -d master -Q"sp_helplogins"
    >c:\users\logins.txt
    OSQL -Usa -Ppassword -Sservername -d master-Q"sp_helplogins"
    >>c:\users\logins.txt
    OSQL -Usa -Ppassword -Sservername -d master -Q"sp_helplogins"
    >>c:\users\logins.txt

    Do the same for all servers.

    Save this as a batch file and run when ever you require

    Thanks
    Hari
    MCDBA

    "zukky" <zukky@discussions.microsoft.com> wrote in message
    news:BADF8A1F-722D-48AF-A2F5-6C1FC2A92B03@microsoft.com...
    > I am trying to mantain a database of all logins and users, Please help,
    is there a way I can populate a spread*** with all the users and logins
    for the entire enterprise. We have over 30 installations of sql server,
    doing it singly using sp_helplogins or sp_helpuser for each server will be
    very difficult


  • Next message: Joachim Hofmann: "Change NT Domain Name with SQL Servers in"