wetmatter nonsense

let's get random 
Filed under

xp_cmdshell

 

enable xp_cmdshell...SQL Server 2005

In order to determine if xp_cmdshell is enabled there are a few ways to go about it. The quickest way for me is to run the following in a query window:

xp_cmdshell 'echo hello world'

If you see Hello World in the output then xp_cmdshell is enabled and you are good to go.

Media_httpbp3bloggercomkclclmdadasjijq5eymjiaaaaaaaaaacqjspsdfsiws320helloworldbmp_lfcaqacbjyejvif

However, if received the following error:

"Msg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1
SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', see "Surface Area Configuration" in SQL Server Books Online. "

that means xp_cmdshell is not enabled! So let's enable it! There are a few ways to do it...

A. Run a sql statement

  1. EXEC sp_configure 'show advanced options', 1
  2. RECONFIGURE
  3. EXEC sp_configure 'xp_cmdshell', 1
  4. RECONFIGURE


B. Use the GUI

  1. Open SQL Server Surface Area Configuration
  2. Click on Surface Area Configuration for Features

  3. Media_httpbp2bloggercomkclclmdadasjilzudocsiaaaaaaaaaakw5yiqqmcpeus320enablexpcmdshellscreen1bmp_clnysjemydiljhd

  4. Click on xp_cmdshell
  5. Media_httpbp1bloggercomkclclmdadasjimbehuq7iaaaaaaaaaasbesy77uuec8s320enablexpcmdshellbmp_htchsfihfuyadcc

  6. Check Enable xp_cmdshell

  7. Click OK

Filed under  //   database   rdbms   sql server 2005   xp_cmdshell  
Posted by Samson Loo 

Comments [0]