Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin.
Search for scripts directly from SSMS, and instantly access any saved scripts in your
SSC briefcase from the favorites tab.
Download now (direct download link)
Thank this author by sharing:
By Donald Patterson,
This is an enhancement to the sp_helprevlogin stored procedure. As a DBA I'm always asked to grant access to an account based on another and it can be difficult at times.
This procedure takes in a login name, windows or SQL, and will generate the access and authorities for the login across the SQL instance. The script generates the user's login, any server roles the login may have, database access and database roles that have been granted, and any specific permissions granted on the database and authorities granted on objects. Everything gets outputed onto the message tab. The output can be copied into a query window and with a replace of the login id, access can be quickly granted to another user.
If the login name is not provided, an error will be generated
EX - sp_capture_login_auths 'domain name\snooze'
EX - sp_capture_login_auths 'snooze'
grant access to all databases
How to grant a login access to that db when that db is in "StandBy /ReadOnly" mode?
auto generate logins
Generating SQL Logins\users and permissions for a database
Looking for T-SQL scripts that will show logins, rights and database they have access too