private void EndpointUpdateUngroupedComputers() { if (CheckDBConnection()) { // Update the data grid DataTable d = wsus.GetUnassignedComputers(); foreach (DataRow dr in d.Rows) { epRowData r = new epRowData("Not Assigned to a Group"); r.EndpointName = dr["name"]; r.ipAddress = dr["ipaddress"]; r.SetUpstreamServerByGuid(dr["parentserverid"], cfg.wsus.server); AddUpdateEndpointGrid(r); } } }
private void EndpointUpdateApproved() { if (CheckDBConnection()) { // Retreive the list of approved updates that have not yet been applied. DataTable t = wsus.GetApprovedUpdates(); foreach (DataRow d in t.Rows) { epRowData r = new epRowData("Uninstalled Approved Updates"); // Fill in data grid r.EndpointName = d["fulldomainname"]; r.ipAddress = d["ipaddress"]; r.ApprovedUpdates = int.Parse(d["approvedupdates"].ToString()); r.LastContact = DateTime.Parse(d["lastsynctime"].ToString()); r.SetUpstreamServerByGuid(d["parentserverid"], cfg.wsus.server); AddUpdateEndpointGrid(r); } } }
private void EndpointUpdateErrors() { if (CheckDBConnection()) { // Update the data grid; DataTable t = wsus.GetUpdateErrors(); foreach (DataRow d in t.Rows) { // Fill in data grid epRowData r = new epRowData("Updates With Errors"); r.EndpointName = d["fulldomainname"]; r.ipAddress = d["ipaddress"]; r.ErrorUpdates = int.Parse(d["updateerrors"].ToString()); r.LastContact = DateTime.Parse(d["lastsynctime"].ToString()); r.SetUpstreamServerByGuid(d["parentserverid"], cfg.wsus.server); AddUpdateEndpointGrid(r); } } }
private void EndpointIncorrectGroupUpdate() { // Get the group rules and sort by priority clsConfig.ComputerGroupRegexCollection rules = cfg.ComputerRegExList; rules.SortByPriority(); if (CheckDBConnection()) { // Update the data grid; DataTable t = wsus.GetComputerGroups(); foreach (DataRow d in t.Rows) { // Attempt to match the computer to a rule clsConfig.ComputerGroupRegEx rx = rules.MatchPC(d["name"].ToString(), d["ipaddress"].ToString()); // Do we have a match? if (rx != null) { // Yes - does it match the computer group we have? if (d["groupname"].ToString() != rx.ComputerGroup) { // No - is it in a group we're supposed to be ignoring? if (!cfg.IgnoreComputerGroupCollection.Values.ToArray().Contains(d["groupname"].ToString())) { // No - add it. epRowData r = new epRowData("Incorrect Computer Group"); r.EndpointName = d["name"]; r.ipAddress = d["ipaddress"]; r.ComputerGroup = rx.ComputerGroup; r.ExtraInfo = "Currently in " + d["groupname"].ToString(); r.SetUpstreamServerByGuid(d["parentserverid"], cfg.wsus.server); AddUpdateEndpointGrid(r); } } } } } }