Quantcast
Channel: Task Scheduler Managed Wrapper
Viewing all articles
Browse latest Browse all 2206

New Post: Error when running V1 - Unable to establish existence of the account specified

$
0
0
I just tried using SCHTASKS and the task created correctly. When i use this wrapper i noticed that the task gets created on the remote device but fails to run. If i open the task in task manager and re enter the password then the task will run.

Here is the string that works with schtasks:

SCHTASKS /Create /S 10.160.8.58 ABC /U user /P pass /RU user /RP pass /SC HOURLY /TN doc /TR notepad

and here is the c# code for the actual task creation:
   TaskDefinition td = ts.NewTask();
                                            td.RegistrationInfo.Description =
                                                "Runs the deploycheck.exe";
                                            td.Principal.LogonType = TaskLogonType.InteractiveTokenOrPassword;
                                           
                                            td.Actions.Add(new ExecAction(program, origArguments, @"c:\temp\"));

                                            Task task = ts.RootFolder.RegisterTaskDefinition(taskName, td,
                                                TaskCreation.Create, "user", "pass",
                                                TaskLogonType.Password, null);
Thanks

Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>