• Try this query given below.

    use

    master

    go

    select

    * from sys.server_principals where type in ('U','G','S')

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com