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 Shirley Bouzon,
These scripts will extract security for Windows Logins, Database Users, Roles, Objects and SQL Logins.
The only caveat is that the sql logins do not script it's database user or roles tied to it.This was taken from several sources online and changed to fit what I needed. You can run this as results to text and save, or results to file. I used this as backup scripts before making security changes.
Error with Create Login Script
How can I script logins nightly?
Compare the logins and users on two instances and generate a TSQL script to make them the same.
Script Removal of Logins - SQL 2005