Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

xp_cmdshell unresponsive Expand / Collapse
Author
Message
Posted Thursday, November 8, 2007 10:27 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, October 17, 2014 11:07 AM
Points: 2,185, Visits: 1,986
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
Post #420187
Posted Thursday, November 8, 2007 10:50 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, May 23, 2012 6:40 AM
Points: 7, Visits: 103
YOu have to switch this feature on using SSCM.
Post #420201
Posted Thursday, November 8, 2007 10:59 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, October 17, 2014 11:07 AM
Points: 2,185, Visits: 1,986
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
Post #420204
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse