0

I have been using SQL Server 2016's SQL Server Agent with bottom setting and script for last 3+ years. It was/is working fine.

enter image description here

But, now, I am migrating everything to SQL Server 2019, but the same command does not work.

So, I am wondering if there is anything that I have to modify (in terms of script) because I am using SQL Server 2019.

When I use SQL Server Agent to run other Powershell script (which executes something within Powershell), it works.

When I run the Powershell now, and I am getting this error message:

enter image description here

asked Aug 12, 2024 at 17:40
8
  • 1
    Have you looked at this? reddit.com/r/SQLServer/comments/jfrcyt/… Commented Aug 13, 2024 at 18:48
  • @JonathanFite What does it mean by "you should use a Proxy to run Python just like you would SSIS"? Commented Aug 13, 2024 at 20:02
  • 1
    What's the error message? Commented Aug 14, 2024 at 22:32
  • @J.Mini Please see the updated post with error mesage. Actually, when I just ran the Powershell file which executes Python file, I see the error on the top. It appears that SQL Server Agent is now out of scope. So strange. Commented Aug 15, 2024 at 0:56
  • 1
    @Java You're screwed. I've had similar problems on my own box. Unless you can grant the group policy that allows impersonation, then your only choice is to make the account a full Admin. Talk to your Windows people. Commented Aug 15, 2024 at 16:18

1 Answer 1

1

If you're not going to specify the program to run the .py file, you need Windows to have a default for that file type. Instead, specify the python executable/binary. This would be an example of what your final line should be, but you'll need to edit it to point to your python binary:

Start-Process C:\Path\To\Python\Executable\python.exe "$cmd"
answered Aug 15, 2024 at 18:46
5
  • It appears that it is working (with modifying the line), but don't I have to fix the original issue with some type of AD or group policy? Commented Aug 15, 2024 at 18:59
  • 1
    Are you getting an additional error? If so, what is it? Commented Aug 15, 2024 at 19:06
  • I do not see error now (by modifying that line). It is working. But, I am not sure whether I need to fix any set up in AD (for later). Commented Aug 15, 2024 at 19:08
  • 1
    That'll depend on whether you're using a different AD account for the SQL Agent than you were before. Commented Aug 15, 2024 at 19:20
  • So, it is not like a major issue, but only affecting AD account for the "SQL Agent" then, I guess. Commented Aug 15, 2024 at 20:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.