How to Activate xp_cmdshell Server Configuration Option



Share this article :

This article is originally taken from Microsoft website. No idea to write a new article – actually, just too lazy today, to be honest, 🙂

The xp_cmdshell option is a SQL Server server configuration option that enables system administrators to control whether the xp_cmdshell extended stored procedure can be executed on a system. By default, the xp_cmdshell option is disabled on new installations and can be enabled by using the Policy-Based Management or by running the sp_configure system stored procedure as shown in the following code example:

Open the SQL Management Studio and hit below commands,

To allow advanced options to be changed

EXEC sp_configure 'show advanced options', 1;  
GO  

To update the currently configured value for advanced options

RECONFIGURE;  
GO  

To enable the feature

EXEC sp_configure 'xp_cmdshell', 1;  
GO  

To update the currently configured value for this feature

RECONFIGURE;  
GO

Related posts

Install Microsoft SQL Server 2008 R2 using SQL4SAP
Detach & Attach SQL Server 2008 R2 Database
Define MSSQL Server Recovery Model
Rename MSSQL Server Database
© 2017 ITsiti. All Rights Reserved
Powered by KEEM