sql server master.dbo.xp_cmdshell error : access denied

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mikenews
    New Member
    • Sep 2014
    • 1

    sql server master.dbo.xp_cmdshell error : access denied

    Hello all,

    I'm new.
    I'm trying to run a scheduled task from SQL Server.
    The meaning is to run it from a server to another server. Let's say that Server1 is where the command is executed and the scheduled task exists in the Server2. Here's what i do :

    EXEC master.dbo.xp_c mdshell "net use \\Server2 password /user:username /persistent:yes"

    exec master.dbo.xp_c mdshell 'schtasks /run /S Server2 /U username /P password /tn "TaskName"'


    When i execute it i get this error : Error : access is denied.

    Can you tell me what's wrong ?

    Thank you very much.

    Mikenews
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Check the account being used to run the command shell. And see if it has the necessary rights. Not because you run it does not mean it's using your account.

    Good Luck!!!


    ~~ CK

    Comment

    Working...