How to run windows task schedular using Service Account

Gani_tpt 1,446 Reputation points
2023-03-21T12:55:44.82+00:00

I am developing many tools using .NET EXE and SSIS packages.

My question is,

I want to run all the scheduler (EXE and SSIS Packages) using service account.

I have two accounts.

One is "Admin" Account.

Two is "Service" Account.

Admin Account password will change every 40 days.

Service Account password won't change (Static and Strong Password).

So, I am planning to use service account for the scheduling the task.

For this, i am logging in server using Admin Account and then configure the scheduling the task using service account.

I am facing the problem below.

  1. Whenever the admin account password getting expired, my task scheduler will stop or getting error due admin password expired.
  2. If i use both are Service Account (Logging the server and scheduling the task, then it will work fine) - But, this is not advisable. Because, Service account password is Static and it may hack/share the credentials to anyone.
  3. I want the solution like below.
      I am always should logging using Admin account, and configure the task scheduler should use Service Account.
    

Is it possible to do the above...?

Or what is the alternative solution to run the task using service account.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,261 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,436 questions
0 comments No comments
{count} vote

Accepted answer
  1. ZoeHui-MSFT 32,001 Reputation points
    2023-03-22T07:41:52.3733333+00:00

    Hi @Gani_tpt,

    What about using Execute Process Task to run the .NET EXE?

    And then you may schedule the package with sql agent job.

    You may use proxy account to run the job to avoid sharing the credentials.

    https://www.mssqltips.com/sqlservertip/2163/running-a-ssis-package-from-sql-server-agent-using-a-proxy-account/

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.


2 additional answers

Sort by: Most helpful
  1. Ben Miller (DBAduck) 951 Reputation points
    2023-03-22T03:01:42.6066667+00:00

    Did you create the Task using the Run As account in the task itself? You have the option to use that mechanism in all Tasks.

    0 comments No comments

  2. Ben Miller (DBAduck) 951 Reputation points
    2023-03-22T03:06:37.22+00:00

    You can use the Run As account in the task. Set that to the Service Account and Password.