Home Forums SQL Server 2005 Administering execute xp_cmdshell - cant get it to work - no matter what - any one? RE: execute xp_cmdshell - cant get it to work - no matter what - any one?

  • Lynn Hendricks (5/5/2015)


    I've tried every possible solution found on the web to get xp_cmdshell working from within a stored proc, called from within an application. The current_user when the stored proc is running is an application role. The system_user is the person logged in, lets say me(while I'm testing), and I have sysadmin rights(which is really puzzling). I get the execute permission denied message. I've setup the proxy account - a windows account, set up a local user in the master, with execute permissions on xp_cmdshell, then tried impersonating that user. Get the principle cannot be impersonated. Yes, I tried with and without impersonating.

    Added the same local user to that database, and to the securables on the application role. same error.

    Tried every step I found on getting xp_cmdshell to work(when goggling) and cannot. What could I be missing? I cant get the application role a direct execute permissions on the extended stored procedure, anyone know of any work arounds, Or have had to use this type of process in the past.

    Put in over 8 hrs trying every possibility, help!!!

    thanks!!!

    Try setting the owner of the database to "SA" (even if it's disabled... and it should be) and then setup the proc to execute as owner. Next, you have to grant the user permission to execute that stored procedure. Note that I did NOT say to grant the user privs to execute xp_CmdShell directly, which would be a huge security violation.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)