/// <summary> /// The do run set classification. /// </summary> /// <param name="server"> /// Object representing the WSUS server /// </param> /// <param name="computerTargetGroup"> /// The target group to check /// </param> /// <param name="classification"> /// </param> /// <param name="isTest"> /// Whether we are in test mode /// </param> /// <param name="alreadyProcessed"> /// List of target groups that have already been processed /// </param> private static void DoRunSetClassification( IUpdateServer server, IComputerTargetGroup computerTargetGroup, Classification classification, bool isTest, List <IComputerTargetGroup> alreadyProcessed) { // check the classification exists on wsus IUpdateClassification uc = server.GetUpdateClassification(classification.Guid); // check for a product collection UpdateCategoryCollection products = classification.Products.ElementInformation.IsPresent ? GetUpdateCategoryCollection(server, classification.Products) : null; if (classification.ApproveStaleUpdates) { CheckStaleUpdates( server, classification.AcceptLicenseAgreement, computerTargetGroup, uc, products, isTest); } if (classification.ApproveSupersededUpdates) { CheckSupersededUpdates( server, classification.AcceptLicenseAgreement, computerTargetGroup, uc, products, isTest, classification.ShouldApproveUninstalledSupersededUpdate); } if (classification.ApproveNeededUpdates) { CheckClassification(server, uc, computerTargetGroup, isTest, alreadyProcessed); } }
/// <summary> /// The do run set classification. /// </summary> /// <param name="server"> /// Object representing the WSUS server /// </param> /// <param name="computerTargetGroup"> /// The target group to check /// </param> /// <param name="classification"> /// </param> /// <param name="isTest"> /// Whether we are in test mode /// </param> /// <param name="alreadyProcessed"> /// List of target groups that have already been processed /// </param> private static void DoRunSetClassification( IUpdateServer server, IComputerTargetGroup computerTargetGroup, Classification classification, bool isTest, List<IComputerTargetGroup> alreadyProcessed) { // check the classification exists on wsus IUpdateClassification uc = server.GetUpdateClassification(classification.Guid); // check for a product collection UpdateCategoryCollection products = classification.Products.ElementInformation.IsPresent ? GetUpdateCategoryCollection(server, classification.Products) : null; if (classification.ApproveStaleUpdates) { CheckStaleUpdates( server, classification.AcceptLicenseAgreement, computerTargetGroup, uc, products, isTest); } if (classification.ApproveSupersededUpdates) { CheckSupersededUpdates( server, classification.AcceptLicenseAgreement, computerTargetGroup, uc, products, isTest, classification.ShouldApproveUninstalledSupersededUpdate); } if (classification.ApproveNeededUpdates) { CheckClassification(server, uc, computerTargetGroup, isTest, alreadyProcessed); } }