• jack_walker - Wednesday, May 2, 2018 1:40 PM

    I have a stored procedure that uses xp_cmdshell to copy a file from one folder to another (right now just trying to copy to a folder on the same server but eventually needs to copy to a share on another server).  I am getting "access denied" even though I have set up a ##xp_cmdshell_proxy_account## credential and a powershell proxy account linked to the credential.  The credential are tied to my own network credentials which has full access to the folder.  This is all on a Windows Server running SQL Server 2017.  I had this all set up on an older server with no issue.  Any ideas?  Thanks in advance!

    It seems like the stored procedure is not picking up the proxy account???

    Why are you involving PowerShell for this?  Just use xp_CmdShell directly.  Either that or just use PowerShell.  There's no need to use both and I think it may be a part of the problem on newer servers.

    If you could post the code that created the Cmd Shell proxy, that may also help.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)