StoredProc cannot create folder on mapped drive

  • Hello everyone,

    Using SQL Server 2014 Dev, I have a StoredProc automatically executed each night. This SP calls an external .EXE console program developped in VB.NET. This program needs to create a folder and copy files into this newly created folder, among other things it does. The folder has to be created on a mapped drive located on a remote server. Path of the mapped drive is under the form "\\192.168.1.1\RootFolder\DestinationFolder". The mapped drive is connected using a local admin user.

    When executed automatically, it always failed giving the error "access denied" when trying to create the folder. When I execute the program manually, it works perfectly. 

    On the remote server, the RootFolder has Everyone with all rights enabled.
    SQL Agent runs using a local account with administrative privileges
    The .EXE console program has elevated privilege with Run As Admin enabled.

    I don't understand what might be the problem. Anyone has an idea and can help me?

    thanks a lot for your time and help

  • When you execute the program, I assume you're executing the console program. That means your security context. Are you running this from your machine or the server?

    Agent can run under the agent service account or a proxy. You need to determine which is being used as this affects security context. You can set up a job step to run whoami > somefile.txt and capture security context. That will help you. Access denied is just that.

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

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