• krishna85 (3/27/2015)


    Script is really good and it helps a lot.

    Does this script resolves the issues with Orphan Users?

    If not it would be good if we include that portion in the script as well....

    When you say "resolves", do you mean delete orphaned users? If so, that is not really what this script is designed to do. It is designed to script out permissions within a database to help with restoring those permissions, generally when a database is pulled down from production to a non-production environment where different permissions will be established. If a database user is not mapped to a login, there multiple reasons why a user may exist without a login. Here are two of them: 1) Users that exist in contained databases that will not be assigned with a login, and 2) users created "WITHOUT LOGIN".