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

New Post: getting security information for a task

$
0
0
Thanks, I spent a better part of the day looking in the tasksecurity class. LOL. I went and looked at your source code for the interface and was able to identify the task.definition class.
Just getting familiar with the wrapper.

I would like to extend a big thanks for this work.
Now on to figuring out how to change the password for the Task.

I know peeps like to see code, that is how we learn. Simple stuff so far, but just in case someone else runs into this.
   class Program
    {
        static void Main()
        {

            using (TaskService ts = new TaskService("wtxwt0017"))
            {
                EnumTaskFolders(ts.RootFolder);

            }



        }

        public static void EnumTaskFolders(TaskFolder taskFolder)
        {
            foreach (Task task in taskFolder.Tasks)
            {
                listTasks(task);

            }
            Console.ReadLine();
        }

        public static void listTasks(Task t)
        {
            
            string userid = t.Definition.Principal.ToString();       

            Console.WriteLine(string.Format("task name = {0} , userid - {1}", t.Name, userid));
        }

       
    }
    
}

Viewing all articles
Browse latest Browse all 2206

Trending Articles



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