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