Microsoft SQLServer/Reporting Services 8. 12. 2010 CZ

Enable xp_cmd_shell on SQL server 2008 or 2008R2

Jak bezpečně povolit `xp_cmdshell` na SQL Serveru 2008 nebo 2008 R2, včetně použití proxy účtu pro non-sysadmin přístup.

If you need to enable xp_cmd_shell for someone who is not the sysadmin on your SQL Server following is required:

1. run this transact sql commands:

EXEC sp_configure ‘show advanced options’, 1
GO
RECONFIGURE
GO
EXEC sp_configure ‘xp_cmdshell’, 1
GO
RECONFIGURE
GO

2. for non sysadmin accounts run this transact sql command with proxy account that has sysadmin rights:

EXEC sp_xp_cmdshell_proxy_account ‘LOGIN’, ‘PASSWORD’

Thats it 🙂