Access denied for enabled xp_cmdshell for the admin user

47,294

Solution 1

Likely insufficient NTFS permissions. Make sure the 'user account' that the SQL Server is running as, has permission (Read+Execute) to the *.EXE (and any dependent files)

Solution 2

Use xp_cmdshell to run "whoami", then check effective permissions for the stated user on the exe and any resources it accesses. Odds are that an account like localsystem is being used to run processes via xp_cmdshell.

EXEC xp_cmdshell 'whoami'
Share:
47,294
Joshua H.
Author by

Joshua H.

http://peltiertech.com/WordPress/referencing-pivot-table-ranges-in-vba/ http://chandoo.org/wp/2009/08/19/excel-pivot-tables-tutorial/ http://confluence.jetbrains.net/display/ReSharper/ReSharper+7+EAP http://cheaptweet.com/tweets/1068955310-Get-Evernote-premium-for--using-coupon-code-en2plus-follow-the-google-checkout-to-the-end-to-enter-the-coupon- http://www.google.com/url?sa=t&rct=j&q=pro%20asp.net%20mvc%203%20framework%20pdf&source=web&cd=1&ved=0CFoQFjAA&url=http%3A%2F%2Fsteamtwentythirteen.googlecode.com%2Ffiles%2FPro.ASP.NET.MVC.3.Framework.pdf&ei=W8HkT9-QN6f96gHXiYjQCg&usg=AFQjCNHu27K3-GiHG2E94lIy5tNcs1kiAA&cad=rja http://docs.oracle.com/javase/tutorial/essential/concurrency/procthread.html http://wdc.custhelp.com/app/answers/detail/a_id/940 http://www.coolestguyplanettech.com/upgrade-jailbroken-iphone-to-ios-5-and-preserve-baseband-with-redsn0w/

Updated on July 05, 2022

Comments

  • Joshua H.
    Joshua H. almost 2 years

    I'm using xp_cmdshell within a database trigger to launch a exe file.

    xp_cmdshell is enabled(it can execute simple cmd command like 'echo'). But when I try to launch the exe through xp_cmdshell, the access is denied.

    I am the database administrator. And I can launch the exe through cmd directly. Anyone know why I get denied and how to fix it?