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...