September 13, 2016 at 2:24 pm
Hi All,
If I need to find out an user account present anywehere in the SQL instances (say, login, jobs, repl agents, db owners, AlwaysOn groups), how to find and remove it?
Thanks
Thanks.
September 13, 2016 at 3:21 pm
SQL-DBA-01 (9/13/2016)
Hi All,If I need to find out an user account present anywehere in the SQL instances (say, login, jobs, repl agents, db owners, AlwaysOn groups), how to find and remove it?
Thanks
Quick suggestion
😎
September 13, 2016 at 3:25 pm
So you are suggesting to extract all the login accounts in the SQL Instance and there if the name matches or present can shed that off?
Thanks.
September 13, 2016 at 3:39 pm
SQL-DBA-01 (9/13/2016)
So you are suggesting to extract all the login accounts in the SQL Instance and there if the name matches or present can shed that off?
That is normally the simplest way;-)
😎
September 13, 2016 at 3:54 pm
lets say at replication the user can have exclusive rights or at alwayson group level oreven at the database level.
Do you suggest running any other scripts to gather a more accurate report?
Thanks.
September 13, 2016 at 4:20 pm
For each database check sys.database_principals.
For each login check sys.server_principals.
For each job check suser_sname(owner_sid) from sysjobs.
For each database check suser_sname(owner_sit) from sys.databases.
All things have owners, you just need to go through the system tables.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply