Written by:R Teachout6/27/2008 10:06 PM
use [yourdatabasename] exec sp_change_users_login 'Report'
Will Output Something like: user1 0x68940EDA46DDD44E9E25F834E4839F74 bsmith 0x37D7D1FFAC865F44AB99CABFA92E5932 jdoe 0xD12465F809AD2940AAFBB938F0270A9C webuser 0x7C4538615AFD874E999A528283A5793B
These are the orphaned users.
Enjoy!
1 comment(s) so far...
Re: MSSQL: Find Orphaned Users on a databaseHere's a way to run it for ALL databases on a serverexec sp_MSforEachDb 'use ?; select ''?'' as DB; exec sp_change_users_login ''Report'''This will give a list of results that has 2 queries in the listFirst: The database it's for, Second: The list of orphaned usersSweet
Re: MSSQL: Find Orphaned Users on a database
Here's a way to run it for ALL databases on a serverexec sp_MSforEachDb 'use ?; select ''?'' as DB; exec sp_change_users_login ''Report'''This will give a list of results that has 2 queries in the listFirst: The database it's for, Second: The list of orphaned usersSweet