Wednesday, March 7, 2012

getting logins and users for all server in the enterprise

I am trying to mantain a database of all logins and users, Please help, is
there a way I can populate a spreadsheet with all the users and logins for t
he 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 difficultHi,
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"
OSQL -Usa -Ppassword -Sservername -d master -Q"select name from syslogins"[vbcol=seagreen]
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"[vbcol=seagreen]
>c:\users\logins.txt
OSQL -Usa -Ppassword -Sservername -d master-Q"sp_helplogins"
OSQL -Usa -Ppassword -Sservername -d master -Q"sp_helplogins"[vbcol=seagreen]
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...[vbcol=seagreen]
> I am trying to mantain a database of all logins and users, Please help,
is there a way I can populate a spreadsheet 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

No comments:

Post a Comment