Executing xp_cmdshell in SQL-2008

  • Hi,

    I'm trying to execute xp_cmdshell in SQL-2008 by a sql user called 'Checker'.

    I’ve set sp_configure 'xp_cmdshell' to 1 and granted execute xp_cmdshell permissions to this user, but still getting error: The xp_cmdshell proxy account information cannot be retrieved or is invalid. Verify that the 'xp_cmdshell_proxy_account' credential exists and contains valid information.

    Online I found that I have to create a proxy credential, like:

    EXEC sp_xp_cmdshell_proxy_account 'domain\checker', 'password'

    The problem is that the last command is for OS user account only, and not for SQL login.

    Is there a way to grant permissions to execute xp_cmdshell to SQL login?

    Thanks

  • I don't think you understand what the proxy is doing. It is setting the user that xp_cmdshell will be running under in the OS. The SQL User has to have rights to call xp_cmdshell but the proxy is the user that the OS will use to run the commands.

    Clear?

    CEWII

  • Elliot is right, but also note that if you run the account from a member of the administrators group it will execute the command with the privileges of the SQL Server Service account.

    ---
    Timothy A Wiseman
    SQL Blog: http://timothyawiseman.wordpress.com/

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply