SQL Server agent is not authenticated properly on domain

  • Executed as user: Invalid drive specification  0 File(s) copied.  Process Exit Code 4.  The step failed.

    Hi There...

    I have the most peculiar problem.

    2 servers (A and B), both member server on AD domain.

    I want to copy a file from A to B, during job execution, using

    "xcopy c:\file.txt \\Server\share /Y"

    In order to do this A must ask the AD for permission to write to B. I get the error "Invalid drive specification" because the SQL Server Agent user is not authorised by the domain.

    The problem is that, the SQL Server Agent user, infact is a domain user, with all the neccesary rights. The user is a member of the Administrator group on both servers (A and B).

    I have noticed, that when I change the SQL Server Agent LogOn account to LocalSystem, and back to DOMAIN\User, it (sometimes) gives the error "Could not determine if User DOMAIN/User has permissions" It is like, it cannot be verified on the domain, but after some 4 retries, til succeeds.

    I also get these error in the Security eventlog:

    "The redirector was unable to initialize security context or query context attributes."

    "DCOM was unable to communicate with the computer SERVERNAME using any of the configured protocols."

     maybe these errors are related ?!

    All I want to do, really, is to copy a file from A to B. It shouldn´t be rocket science...

    regs,

    Mads of Denmark

  • If you know the SQL Server Agent account password, try logging into the server and try to hit the share as the Agent account to see if it happens outside of SQL Agent with the account itself.

  • Thanks, I hav e tried this already, with success. The problems seems to be that the SQL Server Agent, does not authenticate properly on the AD domain. If I change the SQLAgent user from current domain user to LocalSystem, restart, and then change again to DOOMAIN\User account, it gives the error, that it cannot authenticate the user, even though the user exists on the domain.

     

    regs,

     

    Mads

  • I had somewhat similar problem when I used xcopy. I switched to "copy" and it works now. I'm still trying to find why xcopy does not work when it is executed via SQL JOB.

  • One problem I have found with Active Directory is date/time. Check the system date/time on 1)the SQL Server machine, 2) the end server, 3)the Primary Domain Controller/Backup Domain Controller. Make sure that you are all using the same type of time (GMT, EST, etc). I have found that if the timezones are different or the time is off by too much, that some transfers don't work.

    -SQLBill

  • This is probably not your problem, but just in case; I have many times run into an issue where my folder or files are shared with the right authentication, but users still have trouble getting to them. Sometimes, for whatever reason, the NTFS security is messed up.

    Make sure that the folder is shared with the right security, and that NTFS will allow the everyone group to read and write or whatever to that share. Its possible the network authentication is fine, but it still cant do anything because of local security, in other words.

    just a thought

Viewing 6 posts - 1 through 6 (of 6 total)

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