I have the codebase as below to start a program when the system logs in.
TaskService ts = new TaskService();
TaskFolder tf = ts.RootFolder;
TaskDefinition td = ts.NewTask();
td.Principal.LogonType = TaskLogonType.InteractiveToken;
td.Actions.Add(new ExecAction(strInatalledPath, "/s", null));
LogonTrigger lTrigger = (LogonTrigger)td.Triggers.Add(new LogonTrigger());
Task runningTask = ts.RootFolder.RegisterTaskDefinition("LogonTask", td, TaskCreation.CreateOrUpdate, null, null, TaskLogonType.InteractiveToken, null);
The task is creating perfectly with "NT AUTHORITY\SYSTEM" account,
but it works on some computers in our domain and for others as soon as the system logson, the task starts and it can also be seen in the task manager running, but will not show up the real program (like showing dialogs of the program )that has started. (all
systems in the domain have been tested by users having administrator permissions)
when we kill the process in task manager and start the actual program manually it runs perfectly showing up the dialogs of the program started.
so, please tell me where I am doing wrong and kindly assist me to obtain the required functionality.