xp_cmdshell Problems

  • Help...

    Recently I converted a database from SQL 2K to 2K5 and now I'm trying to get through the hell of debugging issues. I am having issues with xp_cmdshell. I have a sproc in place that performs several cmdshell tasks throughout the process and now they don't work. I can run the commands from the actual command shell on the server and they work fine.

    I enabled xp_cmdshell in the surface area config and my procedure runs as a local admin on the server.

    I know that Microsoft suggests that you use a proxy account but i'd like to avoid that if possible. Is this possible and have I missed anything?

    Thanks,

    Kevin

  • Hi Kevin

    Could you explain more detailed which error(s) you get. This works just fine:

    CREATE PROCEDURE usp_TestCmdShell

    AS

    EXECUTE xp_cmdshell 'dir C:\'

    GO

    EXECUTE usp_TestCmdShell

    Greets

    Flo

  • Yes very simply the error I get is access denied. If I use the dir command it works for me too. I receive errors using ftp, bcp, copy, xcopy etc...If I run the commands directly from the command prompt it works but from inside of SQL Server it fails.

    Any thoughts???

    Kevin

  • Hi

    So it's a problem with the rights. I'm not sure if your user account or the SQL Server Service account needs the rights for the server.

    Hope somebody else has more detailed information.

    Good luck

    Flo

  • Florian Reischl (4/7/2009) I'm not sure if your user account or the SQL Server Service account

    Hi can anybody tell the difference SQL Service Account and User account pls

  • Both the Service Account and my account are in the local administrators group on the server so what else might I be missing.....

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

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