Account running SQL server agent service

  • The other reason I ask this is because recently while I investigate a ssis packge schedueled as a sql job that runs using sql service agent account.

    It is not added to logins, users, but the package job runs successfully using that account. It can SQL task in SSIS packages that creates tables, add constraints etc, but I cannot see this login in SQL server.

  • yes there is impersonation so that when the agent service needs to carry out an admin task it can. However, there is no inheritance, logging into SSMS as the service account would not grant you sysadmin.

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

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Perry Whittle (3/8/2012)


    yes there is impersonation so that when the agent service needs to carry out an admin task it can. However, there is no inheritance, logging into SSMS as the service account would not grant you sysadmin.

    You have to remember that it is not a "group", it is a virtual account. I think that the best way to explain it is that it is only granted those permissions when acting as the service account. However, the login when not acting as the service account (like just logging into SQL Server if it was also added as an SQL Server Login) does not inherit those permissions. Kind of like impersonation. When running the service the domain account is allowed to impersonate the virtual account. However, when simply performing other operations through connections or SSMS it is not inheriting the rights of the virtual account. .

    Thank you both, this start to make sense,

    But like my previous post mentioned, if a SQl agent job(run a ssis package) run using SQL service agent account, does the account have permissions to do tasks in the ssis to drop tables, or add constraints etc?

    The pacakges run successfully, but I don't see the service account is a user in the database the SSIS used, it is not a sysadmin anywhere I see in SSMS, how this could be explained?

    Thanks

  • So, when you tell SSIS to use SQL Server Agent Account it is not using the domain account that you assigned to authenticate the service, it is using the SQL Server Agent Account. Think of it as the domain user as being a car key and the SQL Service Agent Account as the car. The key is already in, so you are telling SSIS to simply use the car. MSSQLSERVER account is a different car. In some cases it is the same key, in others a different one. I think that makes sense? :hehe:

    Jared
    CE - Microsoft

  • SQLKnowItAll (3/8/2012)


    So, when you tell SSIS to use SQL Server Agent Account it is not using the domain account that you assigned to authenticate the service, it is using the SQL Server Agent Account. Think of it as the domain user as being a car key and the SQL Service Agent Account as the car. The key is already in, so you are telling SSIS to simply use the car. MSSQLSERVER account is a different car. In some cases it is the same key, in others a different one. I think that makes sense? :hehe:

    So 1. you confirmed the job is run actually by a sysadmin?

    2. If I right click the job- view history, I can see it has something like this:

    Message

    Executed as user: mydomain\sys$sqlsvc. The step succeeded.

    The account mydomain\sys$sqlsvc is the domain account that runs our SQl server agent service.

    How to explain this?

    Thanks

  • sqlfriends (3/8/2012)


    SQLKnowItAll (3/8/2012)


    So, when you tell SSIS to use SQL Server Agent Account it is not using the domain account that you assigned to authenticate the service, it is using the SQL Server Agent Account. Think of it as the domain user as being a car key and the SQL Service Agent Account as the car. The key is already in, so you are telling SSIS to simply use the car. MSSQLSERVER account is a different car. In some cases it is the same key, in others a different one. I think that makes sense? :hehe:

    So 1. you confirmed the job is run actually by a sysadmin?

    2. If I right click the job- view history, I can see it has something like this:

    Message

    Executed as user: mydomain\sys$sqlsvc. The step succeeded.

    The account mydomain\sys$sqlsvc is the domain account that runs our SQl server agent service.

    How to explain this?

    Thanks

    I know it is confusing... but the answer is because that is the account that is linked to the agent. The virtual account doesn't really exist, because it is virtual. So the linked actual account is the one displayed here.

    Jared
    CE - Microsoft

  • SQLKnowItAll (3/8/2012)


    sqlfriends (3/8/2012)


    SQLKnowItAll (3/8/2012)


    So, when you tell SSIS to use SQL Server Agent Account it is not using the domain account that you assigned to authenticate the service, it is using the SQL Server Agent Account. Think of it as the domain user as being a car key and the SQL Service Agent Account as the car. The key is already in, so you are telling SSIS to simply use the car. MSSQLSERVER account is a different car. In some cases it is the same key, in others a different one. I think that makes sense? :hehe:

    So 1. you confirmed the job is run actually by a sysadmin?

    2. If I right click the job- view history, I can see it has something like this:

    Message

    Executed as user: mydomain\sys$sqlsvc. The step succeeded.

    The account mydomain\sys$sqlsvc is the domain account that runs our SQl server agent service.

    How to explain this?

    Thanks

    I know it is confusing... but the answer is because that is the account that is linked to the agent. The virtual account doesn't really exist, because it is virtual. So the linked actual account is the one displayed here.

    Thank you,

    But can you confirm the following statement is true or not:

    if a sql agent job which runs a ssis pacakge, and it is setup using using SQL server agent service account, then it means we don't need to specifically to give permssions to the domain account which runs the SQl agent service permissions to the database used in SSIS, because the SQL server agent account (not the domain account ) is a sysadmin?

  • sqlfriends (3/8/2012)


    SQLKnowItAll (3/8/2012)


    sqlfriends (3/8/2012)


    SQLKnowItAll (3/8/2012)


    So, when you tell SSIS to use SQL Server Agent Account it is not using the domain account that you assigned to authenticate the service, it is using the SQL Server Agent Account. Think of it as the domain user as being a car key and the SQL Service Agent Account as the car. The key is already in, so you are telling SSIS to simply use the car. MSSQLSERVER account is a different car. In some cases it is the same key, in others a different one. I think that makes sense? :hehe:

    So 1. you confirmed the job is run actually by a sysadmin?

    2. If I right click the job- view history, I can see it has something like this:

    Message

    Executed as user: mydomain\sys$sqlsvc. The step succeeded.

    The account mydomain\sys$sqlsvc is the domain account that runs our SQl server agent service.

    How to explain this?

    Thanks

    I know it is confusing... but the answer is because that is the account that is linked to the agent. The virtual account doesn't really exist, because it is virtual. So the linked actual account is the one displayed here.

    Thank you,

    But can you confirm the following statement is true or not:

    if a sql agent job which runs a ssis pacakge, and it is setup using using SQL server agent service account, then it means we don't need to specifically to give permssions to the domain account which runs the SQl agent service permissions to the database used in SSIS, because the SQL server agent account (not the domain account ) is a sysadmin?

    My answer to you is... test it 🙂 but I think that is true. I can test it when I get home.

    Jared
    CE - Microsoft

Viewing 8 posts - 16 through 23 (of 23 total)

You must be logged in to reply to this topic. Login to reply