Sql agent access denied

  • Hi!

    SQL Server agent is using domain service account which has access to the path.

    Can remote into the server and is able to access path and files BUT when the copy command is used in SQL agent if fails saying that for the SQL agent service account access is denied.

    Thanks in advance.

     

     

     

  • Sounds strange - can you provide more detailed information please:

    • which Agent subsystem is used (SSIS, T-SQL, PowerShell)?
    • which kind of copy command are you running?

    Kind regards!

    Sebastian

  • I assume the Agent has access to both the source and destination directories? Also, are you using UNC paths for remote shares, if you have them?

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Subsystem is using Operating System, have enabled xp_cmdshell

    using this command in sql agent:

    copy /y \\sourceserver\E$\test\*.txt f:\test\*.*

    Agent is local admin to both servers, but have  not specifically provided security to particular folder as it is already admin on the machine.

    • This reply was modified 5 years, 1 month ago by  PJ_SQL.
  • PJ_SQL wrote:

    Agent is local admin to both servers, but have  not specifically provided security to particular folder as it is already admin on the machine.

    Agent being an administrator of another server is a pretty bad idea, in my opinion. Anyone with access to the agent could wreak havok. If Agent is using xp_cmdshell, what credentials is that being run under? (I really hope that the Agent User isn't a sysadmin on your Instance.)

    Why are you using xp_cmdshell anyway? Why are you not using a Powershell step and Copy-Item?

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

Viewing 5 posts - 1 through 4 (of 4 total)

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