Avatar of E_Gordon
 asked on

Access is denied when stopping SSRS via SQL job

So, I have a .dtsx package that contains two steps; VB script to stop, then restart, the local Report Server service.  I can execute this package and everything works as-expected.  

I have created a SQL Server Agent job to call this package.

When the job runs, it fails with:
"...System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Cannot open ReportServer service on computer '.'. ---> System.ComponentModel.Win32Exception: Access is denied     --- End of inner exception stack trace --..."

Based on the "Acces is denied" in there, I am assuming that this is a permissions issue.
My question is:  why does this package run "stand-alone', but fail when called as a SQL job?  (Assuming permissions, but...) More specifically, where/what do I need to change to allow SQL to run the package without error?  I have treid changing the SQL job owner to my own account (which runs the package just fine) and also to the "Log On" account of the service (which is a service account; not "local system"); same result...access is denied.

Microsoft SQL ServerMicrosoft SQL Server 2005SSRS

Avatar of undefined
Last Comment
Jason Yousef

8/22/2022 - Mon
Jason Yousef

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

I didn't realize that I had to restart the service after making the change.  I changed the job owner to be the same account as the service Log On, and after a resart of the SQL Agent service it now works...
Jason Yousef

Great ! I always do that and expect it to work too!
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck