Sql-server – How to change user running audits mssql

auditscriptingsql server

I've been tasked with setting up our SQL server audits – despite having never done this before. So please forgive a really basic question.

I setup a specific user, sqlAudits, that I would like to own the audits.

How can I configure an audit to run under the sqlAudits account?

I've searched for hours but all I find it how to audit users, not how to change the account running the audit.

Can anyone point me in the right direction?

Best Answer

despite having never done this before

that's not a problem at all - I just would recommend you do all this on a test server first. the whole process. then you do it in live.


This is how I would do it:

  1. you create the domain account sqlaudits as you mentioned and take note of its password as you will need it later on
  2. create a login for sqlaudit on the server you want to audit

  3. grant sqlaudits all the permissions it might need: on that server

    Check the permissions for altering an audit:

    a)To create, alter, or drop a server audit, principals require the ALTER ANY SERVER AUDIT or the CONTROL SERVER permission.

    b)Users with the ALTER ANY SERVER AUDIT permission can create server audit specifications and bind them to any audit.

  4. run ssms as a different user using the sqlaudits account credentials

to run ssms a different user press the shift and right click on the ssms icon and that will give the options below:

enter image description here

Now you are sqlaudits and the objects you create will be technically owned by you