Change the order of the Relative Distinguished Names (RDNs) in the Subject Distinguished Name (DN) of issued certificates
Microsoft Active Directory Certificate Services does not transfer subjects from certificate requests for templates in which the enrollee is allowed to supply them 1:1 into the issued certificate.
Instead, it is defined both which Relative Distinguished Names (RDNs) are allowed and in which order they are written to issued certificates. However, this order can be changed. How this is done is explained below.
There are applications that compare the subject of the issued certificate with the submitted certificate request. If the order of the Relative Distinguished Names is changed, certificate requests may fail. An example of this is the SSCEP Client for Linux , which is often used in thin clients, among other things. The signing of Appx packages is affected as well.
Determine the current settings
The currently configured order can be checked with the following command line command on the certification authority:
certutil -v -getreg CA\SubjectTemplateThe order is as follows in the default setting:
- CommonName
- OrganizationalUnit
- Organization
- Locality
- State
- DomainComponent
- Country

If the certification authority serves a Network Device Enrollment Service (NDES) , the following RDNs are also defined:
- UnstructuredName
- UnstructuredAddress
- DeviceSerialNumber

Change the order
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.
When changing the value by copy/paste with the Registry Editor, the registry value may become unreadable and the certification authority no longer starts. In this case, it will log event no. 19 .
The order is preferably changed via the command line. Here, all values are entered one after the other in a single line, separated by the line break character.
Example:
certutil -setreg CA\SubjectTemplate "EMail\nCommonName\nOrganizationalUnit\nOrganization\nLocality\nState\nDomainComponent\nCountry"
The certification authority service must then be restarted for the changes to take effect.
Alternative: Disable rebuilding the subject when the certificate is issued
The certification authority can also be configured to accept the requested RDNs without modification. See the article "Use of undefined Relative Distinguished Names (RDN) in issued certificates ".
