How do I enable xp_cmdshell?
Xp_cmdshell is extended stored procedure, with help of this one can execute any kind of Dos commands. Usage of this are: directory listing, creating folders, copy files….
DBA should limit grating this access to users otherwise there is a chance of misutilization and thats why most of the companies disable it for security reasons.
This is a server level option which comes up with Surface Area Configuration, by default xp_cmdshell is disabled on SQLServer. You can enable it by running following query.
USE MASTER
GO
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'xp_cmdshell', 1
GO
RECONFIGURE
GO
You can also enable it through SSMS:
- Connect to SQLServer through SSMS
- Right click on SQLServer and go to Properties
- Click on Facets
- On view Facets page select Surface Area Configuration from drop down list
- Got to XPCmdShellEnabled property and type “True” and click ok.
No comments:
Post a Comment