It is not possible to create a certificate template. Error message "The following template name has already been used"

Assume the following scenario:

  • A new certificate template is to be created.
  • The creation fails with the following error message:
The following template name has already been used: ADCSLaborBenutzerTest. Enter a unique template name.

Error dialog "Certificate Templates": "The following template name has already been used: ADCSLaborBenutzerTest. Enter a unique template name."

Possible causes

Do you know TameMyCerts? TameMyCerts is an add-on for the Microsoft certification authority (Active Directory Certificate Services). It extends the function of the certification authority and enables the application of rule sets to realize the secure automation of certificate issuance. TameMyCerts is unique in the Microsoft ecosystem, has already proven itself in countless companies around the world and is available under a free license. It can be downloaded via GitHub and used free of charge. Professional maintenance is also offered.

The name is really in use

At first glance, the error message is clear: a certificate template with this name already exists.

However, it is important to note that the certificate template management console (certtmpl.msc) displays the display name of the certificate template in the list view ("Template display name", mapped in the displayName attribute of the Active Directory object), but stores the certificate template under the "Template name" (mapped in the "cn" attribute of the Active Directory object).

"Certificate Templates Console": template "ADCS Labor Benutzer Noch ein Test" in the "Template Display Name" list

"Properties of New Template", "General" tab: "Template display name" ADCS Labor Benutzer Test, "Template name" ADCSLaborBenutzerTest

The two fields may differ from each other. The ADSI Editor (adsiedit.msc) provides information. Probably an object already exists which uses this "Template name" but has a different "Template display name".

ADSI Edit, "CN=ADCSLaborBenutzerTest Properties": attribute displayName set to "ADCS Labor Benutzer Noch ein Test"

Active Directory replication

It can also happen that the previous creation or deletion of an object with the same name has not yet been completely replicated. The "cn" attribute is kept in the global catalog and therefore prevents the creation of an object with the same name even before replication has taken place completely.

We have locked ourselves out with permissions

It is also curious that the dialog apparently first saves the certificate template and then renames it - if we do not have permission for the latter, the error may also occur.