Other way to execute the xp_cmdshell command on remote databases from local?

  • Hi all,

    Criteria:

    We connect to the remote database servers through the network from loca by using Query Analyzer.

    Previously we were able to execute the xp_cmdshell command from local Query Analyzer to fetch the remote databases data.

    But now we are unable to execute the xp_cmdshell command on remote databases from local Query Analyzer

    We do not know what happened but i think due to network updates this command is not able to execute...

    For ex:

    Previously i was able to execute master..xp_cmdshell 'net start' from local Query Analyzer.But now not able to execute

    Now my question is, is there any other way(Directly or indirectly) to execute the xp_cmdshell command on remote databases from local?

    Note : we are able to execute this command on remote Query Analyzer but not from local QA

    Any suggestions would be very very helpful to me?

    Thanks in advance,

  • Greetings,

    When you are connected to any SQL Server and execute a command, the command is executed on the server to which you are connected.

    With that in mind, if you are connecting with Windows Authentication the permissions issue you are encountering is probably related to your account's privileges on the SQL Server host machine. If you are connecting with SQL Authentication, the issue is with the SQL Server Service Account's permissions.

    If this is related to a SQL Agent job, there is a 'job step proxy account' configuration setting on the Job System tab of the SQL Server Agent properties dialog that may need to be altered.

    HTH,

    Art

  • R2ro (11/14/2007)


    When you are connected to any SQL Server and execute a command, the command is executed on the server to which you are connected.

    With that in mind, if you are connecting with Windows Authentication the permissions issue you are encountering is probably related to your account's privileges on the SQL Server host machine. If you are connecting with SQL Authentication, the issue is with the SQL Server Service Account's permissions.

    If this is related to a SQL Agent job, there is a 'job step proxy account' configuration setting on the Job System tab of the SQL Server Agent properties dialog that may need to be altered.

    If you're executing xp_cmdshell as a member of the sysadmin fixed server role, then the command shell executes under the context of the SQL Server service account. If you aren't a member of the sysadmin fixed server role and have rights to execute xp_cmdshell, it actually executes under the context of the SQL Server Agent Proxy Account. The only impact your rights have is within SQL Server.

    What error do you receive when you try to execute xp_cmdshell from your workstation?

    K. Brian Kelley
    @kbriankelley

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

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