xp_cmdshell, access denied

  • I have created a strored procedure that works fine when run in the same server.

    This prcedure has some extended proc:xp_cmdshell to create some folders

    When the procedure works within 2 SQLSERVER and xp_cmdshell try create folderon another server I got an error.

    If I run the same piece of code from a cmd window, the command run and create the folder.

    About credential:

    the 2 servers are not in the domain.

    The user is administrator and same password for both servers.

    The procedure is executed form management studio (connected as windows authentication).

    The service runs under local system. I need to do this because if I choose a a Windows user, service cannot interact with desktop.

    Haw can I run this script without problem?

    Please anyhelp will be very appreciated.

    Thank

  • When the procedure runs, it will try to connect to the other server with the first server's Local System account, and that will not work. You need to use an account for the mssqlserver service that can access the 2nd server from the first server.

  • - xp_cmdshell needs to be enabled if you want to use it.

    SAC or sp_configure will show it.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

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

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