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

Commented Unassigned: computername\username Access denied [12373]

$
0
0
Hi,

Since version Release 2.5.17 I'm unable to schedule a task using "computername\username"
This worked in version Release 2.4.2

Example:
Computer is Lan
User is LanUser

Please note that it's a local admin account (not domain)
Trying to log in with Lan\LanUser fails with "Access is denied"
Comments: ** Comment from web user: BertDM **

```
WindowsImpersonationContext ImpersoToken = Impersonate(User, Domain, password);
if (ImpersoToken != null)
{
using (ImpersoToken)
{
using (TaskService ts = new TaskService(hostname, null, null, null, !IsVistaOrLater))
{
TaskDefinition tduser = ts.NewTask();
tduser.Actions.Add(new ExecAction("cmd", "/c set >> " + rootPath + "\\Test.txt", null));
ts.RootFolder.RegisterTaskDefinition("Tester", tduser, TaskCreation.Create, Domain + "\\" + User, password, TaskLogonType.Password);
ts.GetTask("Tester").Run();
}
}
}
```


Viewing all articles
Browse latest Browse all 2206

Trending Articles



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