Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


xp_cmdshell unresponsive


xp_cmdshell unresponsive

Author
Message
fhanlon
fhanlon
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2327 Visits: 2271
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
sdesai
sdesai
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 103
YOu have to switch this feature on using SSCM.
fhanlon
fhanlon
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2327 Visits: 2271
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search