Friday, December 13, 2013

Check whether xp_cmdshell is disabled or not

Xp_Cmdshell

- Spawns a Windows command shell and passes in a string for execution.

The Windows process spawned by xp_cmdshell has the same security rights as the SQL Server service account.
xp_cmdshell operates synchronously. Control is not returned to the caller until the command-shell command is completed.
xp_cmdshell can be enabled and disabled by using the Policy-Based Management or by executing sp_configure
To check whether xp_cmdshell is disabled or not. Run the following Query.
SELECT CONVERT(INT, ISNULL(value, value_in_use)) AS config_value
FROM sys.configurations
WHERE name = 'xp_cmdshell' ;


To enable the xp_cmdshell, you can refer the following msdn doc.

Reference : http://technet.microsoft.com/en-us/library/ms175046(v=sql.105).aspx
                 http://technet.microsoft.com/en-us/library/ms190693(v=sql.105).aspx
                 

No comments:

Post a Comment

Please include your thoughts/suggestion to make it as a better blog. If you find it useful, Please update with your valuable comments, so that others can use it.