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.
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
- EXEC sp_configure 'show advanced options', 1
- RECONFIGURE
- EXEC sp_configure 'xp_cmdshell', 1
- RECONFIGURE
B. Use the GUI
0 comments:
Post a Comment