xp_cmdshell unresponsive

  • On our test server SQL 2005 SP2 we have enable xp_cmdshell. We use this for many purposes (deleting old files, making email attachments etc) I have seen no problems here. If I execute

    xp_cmdshell 'echo hi'

    I get:

    output

    -----------

    hi

    NULL

    On our production server (which so far I haven't found any differences to test) If I execute xp_cmdshell 'echo hi'

    I get

    output

    -------

    NULL

    Likewise no other command I have tried works. I just get a NULL output. I have verified xp_cmdshell is active by executing:

    exec sp_configure 'show advanced option', '1'

    go

    RECONFIGURE

    go

    sp_configure 'xp_cmdshell', '1'

    go

    RECONFIGURE

    go

    as well as verifying xp_cmdshell is enabled in SQL Server Surface Are for Features.

    I am sure this was working a few weeks ago. Any thoughts as to why it might not be working now? I have checked the event viewer and saw nothing odd. The SQL log is odd only in that it does show up in date order. That is I see entries like:

    10/27/2007 10:00:01 PM ...

    10/27/2007 10:00:00 PM ....

    11/4/2007 11:00:00 PM ..

    11/4/2007 10:00:01 PM ....

    ...

    11/3/2007 11:03:25 PM ..

    But there are no messages indicating anything wrong with xp_cmdshell.

    On both servers SQL was installed using Localsystem as the startup account.

    I have tried on the production server creating a job where the first step is an operating system command, like echo hi and this works. If I change the job to be Transact SQL script and type xp_cmdshell 'echo hi', there is no output the same result as in SSMS.

    Has anyone seen (and corrected) this kind of behaviour?

    Francis

  • YOu have to switch this feature on using SSCM.

  • Thanks but as I mentioned I have switched this feature on. If I hadn't switched this on I would have got the error message:

    Msg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1

    SQL Server blocked access to procedure 'sys.xp_cmdshell' .....

    But I don't get an error message: Regardless of the command entered I get

    output

    ----------

    NULL

    Francis

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

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