none
certreq -submit -attrib "Template Name" XXXX.csr XXXX.CER error RRS feed

  • Question

  • We are trying to automate bulk certificate request submition and export cer fil process using script. The below command we are trying to use for submit the CSR to CA and export the CER file to a specific path. 

    certreq -submit -attrib "Template Name"  XXXX.csr XXXX.CER error

    We are getting error that 

    The request contains no certificate information. 0x80094801 (-2146875391 CERTSRV_E_NO_CERT_TYPE)

    but using MMC console we can successfully submit the CSR and generate the certificate.

    Please provide your inputs on this


    Friday, October 4, 2019 12:01 PM

Answers

  • If I remember correctly, you must use the CN of the template (no space name) rather than the Display Name (with spaces).

    Brian

    • Proposed as answer by MC Manikandan Saturday, October 5, 2019 11:55 AM
    • Marked as answer by hariharanss Tuesday, October 8, 2019 10:17 AM
    Friday, October 4, 2019 4:02 PM

All replies

  • If I remember correctly, you must use the CN of the template (no space name) rather than the Display Name (with spaces).

    Brian

    • Proposed as answer by MC Manikandan Saturday, October 5, 2019 11:55 AM
    • Marked as answer by hariharanss Tuesday, October 8, 2019 10:17 AM
    Friday, October 4, 2019 4:02 PM
  • If you can successfully submit request in MMC, then certificate template information is already included in request. So just remote attributes from command call:

    certreq -submit req.csr cert.cer


    Vadims Podāns, aka Crypt32
    My weblog: www.sysadmins.lv
    PowerShell PKI Module: PSPKI
    Check out new: SSL Certificate Verifier
    Check out new: ASN.1 Editor tool.

    Saturday, October 5, 2019 1:53 PM
  • Hello,
    Thank you for posting in our TechNet forum.

    From the article Certreq, we can see:



    So we can try the following steps:

    1. Duplicate a certificate template (in my example, it is Computer3).

    2. Create a .inf file with RequestType = PKCS10.

    3. Generate the .req file with .inf file.

    certreq.exe -q -new <the full path of inf file> 
    <the full path of req file>



    4. Generate .cer file with .req file.

    certreq.exe -submit <the full path of req file> 
    <the full path of cer file>





    Reference:
    PKCS #10 Request




    Best Regards,
    Daisy Zhou

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, October 7, 2019 2:44 AM
    Moderator
  • Dear All,

    Thanks much for your support. we tried with the following parameters in test environment and its working as expected

    certreq -submit -config <hostName with fqdn>\<CA Name> -attrib "CertificateTemplate:<Template Name>" <CSR File Path> <CER output file path>  


    Thanks and Regards,

    Hariharan

    Tuesday, October 8, 2019 10:17 AM
  • Hi,
    Thank you for your update and sharing. I’m very glad that the problem has been solved.
     
    As always, if there is any question in future, we warmly welcome you to post in this forum again. We are happy to assist you!

    Have a nice day!

     
    Best Regards,
    Daisy Zhou

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, October 9, 2019 1:13 AM
    Moderator