public ScheduledTaskConfig() { InitializeComponent(); //check if scheduled task already configured var certifyManager = new Certify.Management.CertifyManager(); TaskConfigured = certifyManager.IsWindowsScheduledTaskPresent(); if (TaskConfigured) { AutoRenewPrompt.Text = SR.ScheduledTaskConfig_AlreadyConfiged; AutoRenewPrompt.Foreground = Brushes.DarkGreen; } }
public ScheduledTaskConfig() { InitializeComponent(); //check if scheduled task already configured var certifyManager = new Certify.Management.CertifyManager(); TaskConfigured = certifyManager.IsWindowsScheduledTaskPresent(); if (TaskConfigured) { AutoRenewPrompt.Text = "The auto renewal task is already configured. If required you can change the admin user account used to execute the task."; AutoRenewPrompt.Foreground = Brushes.DarkGreen; } }
private void OK_Click(object sender, RoutedEventArgs e) { //create/update scheduled task if (!String.IsNullOrEmpty(Username.Text) && (!String.IsNullOrEmpty(Password.Password))) { var certifyManager = new Certify.Management.CertifyManager(); if (certifyManager.CreateWindowsScheduledTask(Username.Text, Password.Password)) { MessageBox.Show(SR.ScheduledTaskConfig_TaskCreated); this.Close(); } else { MessageBox.Show(SR.ScheduledTaskConfig_FailedToCreateTask); } } else { MessageBox.Show(SR.ScheduledTaskConfig_PleaseProvideCredential); } }
private void OK_Click(object sender, RoutedEventArgs e) { //create/update scheduled task if (!String.IsNullOrEmpty(Username.Text) && (!String.IsNullOrEmpty(Password.Password))) { var certifyManager = new Certify.Management.CertifyManager(); if (certifyManager.CreateWindowsScheduledTask(Username.Text, Password.Password)) { MessageBox.Show("Scheduled task created"); this.Close(); } else { MessageBox.Show("Failed to create scheduled task with given credentials"); } } else { MessageBox.Show("Please provide the username and password for an admin level user."); } }