472,145 Members | 1,589 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

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.

Sep 23 '14 #1
1 2685
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
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.