I was wondering if someone could help me, I am trying to list Scheduled Tasks from a specific user (Admin) on the local computer using the TaskScheduler Class (http://www.co
There doesn't seem to be a way to specify a user name when performing the query (only a machine name), but you can filter the results yourself using the Creator
property:
foreach (string taskName in st.GetTaskNames()) {
using (Task task = st.OpenTask(taskName)) {
if (task.Creator == "username") {
listBox1.Items.Add(taskName);
}
}
}