SP with xp_cmdshell gives an error in the MessageQueue, but executes successfully in SSMS.

Hi All,
I have a SP, which calls xp_cmdshell in it. This SP is being used in a MessageQueue. 
The SQL server and Agent services are configured using a Domain service account, and this service account has a login under the sysadmin server role as well.
When the MessageQueue is invoked, the SP returns the following exception :
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.
But when I execute the SP in SSSMS, under the service account login (which is a sysadmin), it successfully executes.
I even created the ##xp_cmdshell_proxy_account## credential, but the Message Queue never stops giving this error.
This is how the queue looks like :
CREATE QUEUE [dbo].[TestxmCmdshellQueue]
WITH STATUS = ON ,
RETENTION = OFF ,
ACTIVATION (      STATUS = ON ,
                        PROCEDURE_NAME = [dbo].[SpWithxp_cmdshell_Init] ,
                        MAX_QUEUE_READERS = 5 ,
                        EXECUTE AS N'dbo'  ),
POISON_MESSAGE_HANDLING (STATUS = OFF) 
The Service account is configured as a Local Administrator in the Local Server as well.
I am running SQL Server 2008 R2 Sp2 on a Windows Server 2008 R2 Enterprise Machine. 
Please let me know what I am missing here.

I Made TRUSTWORTHY = ON in the database and the SP executed without any problem by the Message Queue.
No, that is not the solution.
Yes, it works. And it is a lot simpler than the solution I pointed you to. But it opens a big security hole. Or, well, depending how things you are on your server, it may be entirely uncontroversial. But as long as I don't know anything, I will have
to assume that it is a security hole. And even if there is no one today on the server who is db_owner in the database but who should not be sysadmin, that could happen in the future.
So, to anyone else who is reading this: don't set your databases to be trustworthy, unless you fully understand the implication. The correction solution is to use certificate signing. I describe this in detail in my article, and this article also explains
the dangers with TRUSTWORTHY.
http://www.sommarskog.se/grantperm.html
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Good evening I would please help me, IGood evening I would please help me, I have problems with flash player when update on my computer Flash Player for windows 8, gives me error in the installation that is not apply on my computer. Please help. Thank You

    Good evening I would please help me, IGood evening I would please help me, I have problems with flash player when update on my computer Flash Player for windows 8, gives me error in the installation that is not apply on my computer. Please help. Thank You

    First, confirm that ActiveX Filtering is configured to allow Flash content:
    https://forums.adobe.com/thread/867968
    Internet Explorer 11 introduces a number of changes both to how the browser identifies itself to remote web servers, and to how it processes JavaScript intended to target behaviors specific to Internet Explorer. Unfortunately, this means that content on some sites will be broken until the content provider changes their site to conform to the new development approach required by modern versions of IE.
    You can try to work around these issues by using Compatibility View:
    http://windows.microsoft.com/en-us/internet-explorer/use-compatibility-view#ie=ie-11
    If that is too inconvenient, using Google Chrome may be a preferable alternative.

  • Why does itunes give an error saying " The Iphone cannot be synced. An unknown error occured (-50). Everytime I try to sync my phone?

    Why does itunes give an error saying " The Iphone cannot be synced. An unknown error occured (-50)". Everytime I try to sync my phone? I have another Iphone that syncs with the same itunes account and it's working fine.

    What operating system do you have on your computer?

  • My apple RIP gives this error message" the application ppRIPe has unexpectedly quit"

    MY APPLE RIP GIVES THIS ERROR MESSAGE" the application ppRIPe has unexpectedly quit"

    Thanks.
    I should have mentioned that I have already done the Resolving Permissions as outline on Apple Support pages, but, I went ahead and did the complete sequence as shown on Dr. Smokes.
    I decided to stop beating a dead horse and did an Erase and Install of 10.2 again since I did not have anything on there yet. So far, everything is working perfectly. I am doing the Software Updates called for one by one to see if any of those caused the problem.
    The only thing I did other than doing all of the updates after the install was to install OS 9.2 for my Classic Environment software and I also installed an HP PSC 1315v All-In-One scanner/printer. I cannot imagine that would have done anything.
    I did have some strange issues with Where in the USA is Carmen Sandiego and The Star Fleet Technical manual so I may stay away from them unless I start in OS 9 if none of the other updates cause any issues.
    Thanks. BTW, How should I rate your answer? I know that it did not solve my problem, but, it is likely that something else I did whacked something.
    I'll update when I know more.

  • Adobe Acrobat gives an error message "The key file is missing, canceled"

    Hi,
    Adobe Acrobat gives an error message "The key file is missing, canceled" this is a direct translation of the Finnish error message. Acrobat is already re-installed. The operating system is Windows Server 2008 R2, and there is also installed Adobe Reader X.
    BR
    Heikki

    Please let us know do you see this error on every launch of Acrobat?
    Recommended is to have latest version of Acrobat and Reader. i.e. 10.1.8
    Try updating application and then see if you still encounter the error.

  • TS1369 After updating iTunes this week Windows 8 recognizes the iPod but does not offer an option to open with iTunes. iTunes does not recognize iPod Touch. Have followed all the steps but without success. Is there a solution with iTunes?

    After updating iTunes this week Windows 8 recognizes the iPod but does not offer an option to open with iTunes. iTunes does not recognize iPod Touch. Have followed all the steps but without success. Is there a solution with iTunes?

    I followed all the instructions on the suggested page. Many files in C:\Program Files\Common Files\Apple\ and C:\Program Files (x86)\Common Files\Apple\ could not be deleted. Message said ""Cannot delete files: It is being used by another person or program"' but could not find iPodService.exe in task manager (also, the "Cannont delete ... " did not mention iPodService.exe).
    Deleted all that I could. Reinstalled iTunes. Still same result. iTunes and computer both recognize my old iPod. Only the computer recognizes iPod Touch.

  • I cannot play music with my slideshows. I setup the music but it does not play, even with my older slideshows I hear no music.

    I cannot play music with my slideshows. I setup the music but it does not play, even with my older slideshows I hear no music.

    This category is for iPod shuffle.  Is that the type of iPod you have, because your description of the problem does not sound like it's about a shuffle?  If it's not a shuffle, what is the iPod model...?
    There is music there and I can play it connected to laptop.
    Are you doing the playing using the iPod, or are you playing the music using iTunes on the laptop?
    All mucis icons read "No music" and this is not correct
    Do these icons with "No music" appear on the laptop's screen, or on the iPod's screen

  • Hi guys, I was presented with iPhone and then I rewrote the program, but right now, the ability to such a problem ..... want username and password

    hi guys, I was presented with iPhone and then I rewrote the program, but right now, the ability to such a problem ..... want username and password

    I don't understand. What "program" do you mean, and what do you mean by "rewrote"? If you mean that the iPhone has Activation Lock - that is, you restored the iPhone and now it's asking for the previous owner's Apple ID and password to activate the device - then you will need that information, or you'll need to get the previous owner to remove the device from his/her iCloud account:
    http://support.apple.com/kb/PH2702
    If you can't reach the previous owner or he/she is unwilling to cooperate, then the device is unusable by you.
    Regards.

  • I've tried to conduct a secure erase with disk utility. I highlight the drive but erase options are not available.

    I tried to conduct a secure erase with disk utility. I highlight the drive but there's no place to click "erase."

    If you have an SSD, then the best thing you can do it enable System Preferences -> Security -> FileVault, so that any deleted files are just an encrypted jumble of bits to anyone that does not have the encryption key.
    And even if you do erase the SSD, it does not work the way you think, and retired SSD zones may have your data, and never see an erase.
    This is way keeping the SSD encrypted means retired zones are just encrypted jumble of bits.
    If you do NOT have an SSD, is it possible you are trying to erase your boot disk while you are actually using your boot disk?  Disk Utility will not allow you to do that either.

  • When viewing my webmail with firefox there is nothing in the inbox, but all other folders are fine

    problem is when viewing my webmail with Firefox there is nothing in the inbox, but all other folders are fine.

    You can try these steps in case of issues with web pages:
    You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and remove cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • I have recently purchased my mac book with retina.i have explore all the feature but couldn't able to understand how to use my facetime. plz assist me

    i have recently purchased my mac book with retina.i have explore all the feature but couldn't able to understand how to use my facetime. plz assist me
    rahul

    Greetings rahul81,
    After reviewing your post, it sounds like you want to know how to use FaceTime. I would recommend that you read this article, it may be able to help the issue.
    FaceTime for Mac (Yosemite): Make and receive FaceTime calls
    Thanks for using Apple Support Communities.
    Take care,
    Mario

  • Iphone does n't restart and all i see is a blank screen (black screen). I have tried recharging the battrey but no success

    Iphone does n't restart and all i see is a blank screen (black screen). I have tried recharging the battrey but no success

    I rebooted my computer and now it's working.
    When in doubt, reboot, but in my frustration this afternoon it didn't occur to me.
    Thank you all so much for taking the time to answer my question.
    I hope this simple solution will help someone else.
    enjoyride
    I get frustrated with Apple too, but if you've spent any time on an Android device, you would know how lucky we are to have an Apple product. The interface is awful and there are no apps, even to get stuck.
    Again thanks...
    Cyndi

  • GRPO with Freight gives an error ...

    Hello Experts,
    When I post a GRPO without Freight it gives no error, but when I try to add with Freight Amount it gives an ERROR.
    Inventory Account is not defined [Goods Receipt PO - Rows - Warehouse Code] Message 173-77.
    Freight Setup: for that perticulat Freight that I am using... is Revenue and Expense Accounts are defined... Distribution and Drawing Methods are Quantity and Stock Check Box is CHECKED.
    Help Required...
    Thanks & Regards

    Hello Nazir,
    If your the items are set up with 'GL accounts managed by warehouse' (this is defined under the Inventory Tab of the Item Master Data), you should check that all the accounts for the warehouse have been set up under Administration => Set Up => Inventory => Warehouses => Accounting Tab.
    In particulary you should check that you have defined an Expense Account for the specific warehouse in the GRPO document.
    Also since you have chosen to affect the stock with additional expenses you need to specify an offsetting G/L account to the Stock account for clearing journal entries created by A/P Invoices and Goods Receipt POs.                                           
    I hope it solves your issue.
    Kind Regards,
    Magalie Grolleau
    SAP Business One Forums Team

  • Error with Adobe Acrobat X "error opening the document. The file is damaged and could not recover"

    Good morning,
    I have a problem when generating PDF files with Adobe Acrobat X.
    When I give print a Word document 2003 ... 2007 ... 2010 ... and select a network drive to save the PDF file, I get the following error "error opening the document. Thefile is damaged and not could recover."
    The file is saved on your drive well ... but I always get this error.
    Any ideas???
    Thank you.

    First of all thanks for responding.
    The installed version of Adobe's Adobe OS X and Windows XP machines is thelatest patch level.
    The local system .... works well ... Open Office 2010 ... create a new Word document and save it locally ... and all good.
    The problem is though that same machine ... it enters network (not Windows network. OES2 is a network with Novell network client) ... and to open and create a new document to WORD .... when printing the PDF printer ... select a network drive... and when the document is saved well ... but it shows the error.
    I have an amount of hours lost with this ... I hope you can help me find a solution.
    Thank you very much.

  • Since uploading Maverick, my Microsoft apps give an error message "(the app) quit unexpectedly.  Click Reopen to open the application again."  However, this does nothing but renew this window.  What to do?

    Since uploading Maverick, all of my Microsoft apps give an error message "(name of the app) quit unexpectedly.  Click Reopen to open the application again."  However, this does nothing but renew this window.  I have to click on the "OK" button to get rid of the error message.  What to do?

    Very Important, how much Free Space is on your Hard Drive first of all? Click on the Macintosh HD on the Desktop, then do a Get Info on it.
    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    If perchance you can't find your install Disc, at least try it from the Safe Boot part onward.
    Do they launch OK while in Safe Mode?

Maybe you are looking for

  • My ipod shuffle 4g wont play music from a cd

    my ipod shuffle 4g used to play music, and i gave it to my dad. he synced it with a different pc and now music wont play. he put roughly 15 songs from a cd or two and only one plays, however it seems like a non-ear damaging version of static (that's

  • Nokia Orange UK 6500 Slide - Restriction code Pls

    I got a new phone from UK and was trying to use it in USA, when I've inserted the SIM and trying to access the phone, it asks for "RESTRICTION CODE", does anyone can help me in this. History: a) Got the phone b) Bought unlock code c) Seller provided

  • Replacing mp3 w/AIFF

    Hello - I loaded an mp3 into FCP, as I had temporarily forgotten about converting it to AIFF... The thing is, is that I already edited the song into a number of sections, so rather than having to start that from scratch again, is there a way to 'disc

  • MM Pricing for Intercompany STO

    Hi Experts, We have a requirement from our client to configure a pricing procedure as below for the Intercompany STO process. E.g Standard = $100 Mark up = 10% Transfer Price = $110 PO pricing Dr         Inventory/COS                           $100  

  • Character  information at the candidate window in the pinyin input system.

    While learning writing chinese characters with the pinyin input system at an apple store, I found that at the candidate window, already selected a character, the window showed the pinyin with the tone number, the code, the radical and the components