diff --git a/src/CommonLib/Processors/CertAbuseProcessor.cs b/src/CommonLib/Processors/CertAbuseProcessor.cs index 066965b5..005e08bf 100644 --- a/src/CommonLib/Processors/CertAbuseProcessor.cs +++ b/src/CommonLib/Processors/CertAbuseProcessor.cs @@ -170,14 +170,23 @@ public async Task ProcessEAPermissions(string return ret; } - public IEnumerable ProcessCertTemplates(string[] templates, string domainName) + public (IEnumerable resolvedTemplates, IEnumerable unresolvedTemplates) ProcessCertTemplates(string[] templates, string domainName) { + var resolvedTemplates = new List(); + var unresolvedTemplates = new List(); + var certTemplatesLocation = _utils.BuildLdapPath(DirectoryPaths.CertTemplateLocation, domainName); foreach (var templateCN in templates) { var res = _utils.ResolveCertTemplateByProperty(Encoder.LdapFilterEncode(templateCN), LDAPProperties.CanonicalName, certTemplatesLocation, domainName); - yield return res; + if (res != null) { + resolvedTemplates.Add(res); + } else { + unresolvedTemplates.Add(templateCN); + } } + + return (resolvedTemplates: resolvedTemplates, unresolvedTemplates: unresolvedTemplates); } ///