public clsWSUS(clsConfig configobject) { cfg = configobject; // Initialise SQL query sql.ConnectionString = cfg.SQLConnectionString(); if (CheckDBConnection()) { // Set connection to SQL server for all queries cmdLastUpdate.Connection = sql; cmdApprovedUpdates.Connection = sql; cmdLastSync.Connection = sql; cmdUnassignedComputers.Connection = sql; cmdUpdateErrors.Connection = sql; cmdComputerGroups.Connection = sql; } // Connect to WSUS server try { server = AdminProxy.GetUpdateServer(cfg.WSUSServer, cfg.WSUSSecureConnection); wsusStatus = "OK"; } catch (Exception ex) { wsusStatus = "Error: " + ex.Message; } }
public frmIgnoreComputerGroups(clsConfig cfgobject) { cfg = cfgobject; wsus = cfg.wsus; InitializeComponent(); }
public TaskCollection(clsConfig cfgobject) { cfg = cfgobject; // Kick off the background worker wrkTaskManager.DoWork += wrkTaskManager_DoWork; wrkTaskManager.RunWorkerCompleted += wrkTaskManager_RunWorkerCompleted; wrkTaskManager.RunWorkerAsync(SynchronizationContext.Current); }
// Class initialisation. List of groups is also to be passed public UnapprovedUpdates(clsConfig configobject, clsConfig.GroupUpdateRuleCollection showgroups) { // Store the config object for use cfg = configobject; // Store the groups to be managed, sorting them by display order groups = showgroups; groups.SortByDisplayOrder(); }
public frmComputerGroupRules(clsConfig cfgobject) { InitializeComponent(); // Set Priority column as an integer rxPriority.ValueType = typeof(int); cfg = cfgobject; wsus = cfg.wsus; }
public frmDefaultSUS(clsConfig cfgobject) { InitializeComponent(); cfg = cfgobject; // Add each default GUID from the existing configuration foreach (string s in cfg.DefaultSusIDCollection) lstGUIDs.Items.Add(s); }
public frmDefaultSUS(clsConfig cfgobject) { InitializeComponent(); cfg = cfgobject; // Add each default GUID from the existing configuration foreach (string s in cfg.DefaultSusIDCollection) { lstGUIDs.Items.Add(s); } }
public frmPreferences(clsConfig cfgobject) { InitializeComponent(); cfg = cfgobject; // Populate form txtPSExec.Text = cfg.PSExecPath; txtComputerRegEx.Text = cfg.ComputerRegExXMLFile; txtCredentials.Text = cfg.CredentialXmlFile; txtDefaultSUS.Text = cfg.SusIdXmlFile; txtGroupUpdate.Text = cfg.GroupUpdateRulesXMLFile; chkLocalCreds.Checked = cfg.RunWithLocalCreds; }
public frmGroupUpdateRules(clsConfig cfgobject, clsWSUS wsusobject) { // Let the user know something is happening Cursor.Current = Cursors.WaitCursor; InitializeComponent(); cfg = cfgobject; wsus = wsusobject; // Get list of computer groups and sort it. gc = wsus.ComputerGroups; groupnames = new List <string>(); foreach (IComputerTargetGroup tg in gc) { groupnames.Add(tg.Name); } groupnames.Sort(); // Read existing group rules grouprules = cfg.GroupUpdateRules; // Update treeview with existing rules UpdateGroupUpdateRules(); // Set default display order (maximum + 1) numDisplayOrder.Value = grouprules.MaxDisplayOrder + 1; // Set this window to be marginly less wide than the current monitor Rectangle scr = Screen.FromControl(this).Bounds; // Make this window 20 pixels narrower than the current screen and centre it this.Left = 10; this.Width = scr.Width - 20; // Note the current height of the form - this will be the minimum height of the form minheight = this.Height; // Finished - reset cursor to normal Cursor.Current = Cursors.Arrow; }
public frmGroupUpdateRules(clsConfig cfgobject, clsWSUS wsusobject) { // Let the user know something is happening Cursor.Current = Cursors.WaitCursor; InitializeComponent(); cfg = cfgobject; wsus = wsusobject; // Get list of computer groups and sort it. gc = wsus.ComputerGroups; groupnames = new List<string>(); foreach (IComputerTargetGroup tg in gc) groupnames.Add(tg.Name); groupnames.Sort(); // Read existing group rules grouprules = cfg.GroupUpdateRules; // Update treeview with existing rules UpdateGroupUpdateRules(); // Set default display order (maximum + 1) numDisplayOrder.Value = grouprules.MaxDisplayOrder + 1; // Set this window to be marginly less wide than the current monitor Rectangle scr = Screen.FromControl(this).Bounds; // Make this window 20 pixels narrower than the current screen and centre it this.Left = 10; this.Width = scr.Width - 20; // Note the current height of the form - this will be the minimum height of the form minheight = this.Height; // Finished - reset cursor to normal Cursor.Current = Cursors.Arrow; }
public PerGroupCollection(clsConfig.GroupUpdateRuleCollection groups) { // Loop through each group and add to the list and the dictionaries. This is the only way items can be created. foreach (clsConfig.GroupUpdateRule ur in groups) this.List.Add(new PerGroupInformation(ur)); }
/// <summary> /// Scheule a simple task with no dependent tasks /// </summary> private void PSExecCall(IPAddress ip, string computername, clsConfig.SecurityCredential credentials, string command) { try { Task task = tasks.AddTask(ip, computername, credentials, command); task.Ready(); } catch (ConfigurationException ex) { // Could not schedule task - inform user of reason why MessageBox.Show(ex.Message, ex.Summary, MessageBoxButtons.OK); } }
public PerGroupInformation(clsConfig.GroupUpdateRule updaterule) { _grouprule = updaterule; }
public Task AddTask(IPAddress ip, string computername, clsConfig.SecurityCredential credentials, string command) { // Has a valid PSExec path been supplied? if (cfg.PSExecPath == "") // No - throw exception throw new ConfigurationException("No valid path to PSExec has been set in Preferences. Please set a path to PSExec in Helper Preferences.", "PSExec path not valid"); // Did we get valid credentials? if (credentials == null) { // No - do we run with the current credentials? if (!cfg.RunWithLocalCreds) // No - throw exception throw new ConfigurationException("No credentials found for IP address " + ip.ToString() + " and running with local credentials disabled. To run with local credentials, check \"Supply current credentials if no other security credentials found for IP address\" in General Preferences.", "No local credentials found for remote PC"); } // Build the task details Task t = new Task(); t.TaskID = ++_taskidcounter; t.IP = ip; t.Credentials = credentials; t.Computer = computername; t.AddCommand(command); // Add the task to the list and return it this.Tasks.Add(t); return t; }
public frmCredentials(clsConfig cfgobject) { InitializeComponent(); cfg = cfgobject; }
public frmWSUSConfig(clsConfig cfgobject) { InitializeComponent(); cfg = cfgobject; }
public UnapprovedUpdate(clsConfig.GroupUpdateRuleCollection groups, string updateid, string title, string description, string kbarticle, DateTime arrivaldate) { _groups = new PerGroupCollection(groups); _updateid = updateid; _title = title; _description = description; _kbarticle = kbarticle; _arrivaldate = arrivaldate; }