XP_CMDSHELL

  • I am unable to issue the XP_CMDSHELL from a remote PC...

    I am getting message Timed Out or Network Connection Failure error message.....

    Where as if use the same statement on Server Desktop it is executing fine without any issue.....

    I am unable to troubleshoot the issue......

    Could someone help me in this regard.....

  • Can you execute any other statement remotely? (like "select 1" for example)? This will narrow down your problem, and you will know if it is a connection problem, or a permission/timeout problem.

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • I am able to execute all the queries, even the select queries with thousands of rows without any issues.....

    However, I am unable to execute XP_CMDSHELL.....

    I tried executing other extended stored procedures such as XP_Fixeddrives and they are working fine.....

    Please help

  • Have you tried any other commands in xp_cmdshell? Like:

    exec xp_cmdshell 'echo a'

    what does "exec xp_cmdshell 'echo a'" return to you?

    Is the login you are using in the sysadmin role or did you grant exec permission to it separately?

    Also, do you have an intrusive antivirus software that may filter the remote connections and terminate queries with xp_cmdshell in them? Fire up profiler, and see if this query actually reaches your server.

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • Thank you very much for your reply...

    I have tried executing the query you gave and received the following error message:

    [Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionCheckForData (CheckforData()).

    Server: Msg 11, Level 16, State 1, Line 0

    General network error. Check your network documentation.

    Connection Broken

    However, till yesterday it was working fine... I used to check the uptime of the servers with XP_CMDSHELL command and I am unable to do it now...

    Ours servers are running with McAfee 8.5 Enterprise and have Windows Firewall enabled.....

  • IS xp_cmdshell enabled in your instance. If enabled check if you are able to ping the server and there is no network glitches.

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

  • Did your permissions change on the server?

    Are you a member of the sysadmin fixed server role?

    Did the password for the SQL Server service or the SQL Agent Proxy account change recently?

    K. Brian Kelley
    @kbriankelley

  • Hi Sugesh,

    I am also facing the same kind of errors,

    How to enable xp_cmdshell?

    Please suggest

    Regards

  • On 2005 to enable xp_cmdshell:

    EXEC sp_configure 'show advanced options', 1

    GO

    RECONFIGURE

    GO

    EXEC sp_configure 'xp_cmdshell', 1

    GO

    RECONFIGURE

    GO

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

Viewing 9 posts - 1 through 8 (of 8 total)

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