Share via

Catch create user with extended events

Miyagi82 1 Reputation point
2022-04-19T14:58:22.69+00:00

Hello,

I try to catch in extended events session the creation/deletion of a new login.
Already added object_created/object_altered/object_deleted but no success.

I also want to catch the grant and revoke events for the users in extended events.
How can I do that?

Thank you!

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories

0 comments No comments

2 answers

Sort by: Most helpful
  1. YufeiShao-msft 7,156 Reputation points
    2022-04-20T08:49:50.143+00:00

    Hi @Miyagi82

    For your needs, all can be implemented using SQL Server Audit
    you have to audit(like via ddl) the actual REVOKE or DENY statement.
    In SQL Server log, from the default track, you also can see some event about logins and objects are changed
    https://www.sqlservercentral.com/articles/find-permission-changes-in-the-default-trace

    -------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

  2. Erland Sommarskog 134K Reputation points MVP Volunteer Moderator
    2022-04-19T22:00:52.13+00:00

    You should probably look at SQL audit instead, which uses the Extended Events framework under the covers.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.