예제 #1
0
        /// <summary>
        ///
        /// </summary>
        static private void CheckIsValidTargetGroup(
            Microsoft.UpdateServices.Administration.IUpdateServer server,
            TargetGroup targetGroup,
            System.String runSetName
            )
        {
            //make sure the guid exists
            try
            {
                server.GetComputerTargetGroup(targetGroup.Guid);
            }
            catch (System.Exception)
            {
                throw new System.ArgumentException(
                          "The TargetGroup Guid \"" + targetGroup.Guid + "\" could not be found on the WSUS server. Run Set: " + runSetName
                          );
            }

            //check the classifications
            Rule allClassifications = targetGroup.AllClassifications;
            ClassificationCollection classifications = targetGroup.Classifications;

            CheckIsValidClassifications(server, allClassifications, classifications, runSetName, targetGroup.Guid.ToString());
        }