469,125 Members | 1,685 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,125 developers. It's quick & easy.

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_cmdshell "net use \\Server2 password /user:username /persistent:yes"

exec master.dbo.xp_cmdshell '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
Sep 23 '14 #1
1 2401
ck9663
2,878 Expert 2GB
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
Oct 8 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Michael Hetrick | last post: by
reply views Thread by Klaus Bilger | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.