XP_CMDSHELL Error

  • Hello, I have set up and configured xp_cmdshell using a proxy account and I am still getting the below 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. [SQLSTATE 42000] (Error 15153)

    select @@version

    Microsoft SQL Server 2016 (SP2) (KB4052908) - 13.0.5026.0 (X64) Mar 18 2018 09:11:49 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 <X64> (Build 9600: )

    EXEC sp_configure 'xp_cmdshell';

    Capture

    Capture

     

    Use master

    EXEC sp_helprotect 'xp_cmdshell'

    Capture

    Any idea why this is still not working.

    • This topic was modified 4 years, 9 months ago by  oradbguru.
  • When are you getting this error?  When you try to use xp_CmdShell?  If so, please post the code.

     

    --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)

  • Sorry, I posted the wrong code.

    • This reply was modified 4 years, 9 months ago by  oradbguru.
  • I got it to work.  It turns out that the proxy was not set up on the linked server where the xp_cmdshell call is executed from.

    Thank you.

  • oradbguru wrote:

    I got it to work.  It turns out that the proxy was not set up on the linked server where the xp_cmdshell call is executed from. Thank you.

    That sounds like it could be the worst way to use xp_CmdShell there is for purposes of security.  You really do need to post the code that's making the call across the linked server AND the code that gets executed on the linked server so we can help you avoid reading about yourself in the morning news after a breach.

    --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)

Viewing 5 posts - 1 through 4 (of 4 total)

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