xp_cmdshell fails

  • I have an automated program that connects to a number of SQL 7 servers and runs xp_cmdshell.  However, there is one server that it always fails on.  I’ve looked at the configuration on the server and it appears to match the others.  Also note, if you run xp_cmdshell from the query analyzer using the same user account on the offending machine, it runs fine. 

     

    In my app, the connection reports:

    [DBNETLIB][ConnectionRead (recv()).]General network error. Check your network documentation.

    Timeout expired

     

    I’ve tried increasing the command timeout, and changing the data provider (oledb) but that didn’t make a difference.

     

    Anyone have any ideas?  Thanks in advance.

     

  • this sounds a little like the SQL service account may not have the relevant permissions for command executed by xp_cmdshell

    although it's just a wild stab in the dark

    MVDBA

  • Thanks Mike. 

    But it works using the same user and pass through query analyzer.  That's why I suspect it has to do with the connection.

    Ian

  • if it's the connection then that problemw ould apply to all commands issued, not just xp_cmdshell

    have you tried a simple xp_cmdshell 'Dir c:\' command to check other xp_cmdshell actions

    or try another command (sp_who2) from the connection that is causing problems

    MVDBA

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

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