Submitting a CSR and getting a new certificate with Get-Certificate

0

I am trying to get a new certificate from the certificate server, using the following approach:

    $user = "MYDOMAIN\Administrator"
    $pw = ConvertTo-SecureString "mypw" -AsPlainText -Force
    $credential = New-Object -typename System.Management.Automation.PSCredential -ArgumentList $user,$pw
    Get-Certificate -url https://cs.mytest.com/ADPolicyProvider_CEP_UsernamePassword/service.svc/CEP -DnsName $Env:COMPUTERNAME -CertStoreLocation cert:\LocalMachine\My -Template WorkstationTemplate -Verbose -Credential $credential 

However I get back:

VERBOSE: Performing the operation "Get-Certificate" on target "https://cs.mytest.com/ADPolicyProvider_CEP_UsernamePassword/service.svc/CEP".
Get-Certificate : CertEnroll::CX509CertificateTemplates::get_ItemByName: Cannot find object or property. 0x80092004 (-2146885628 CRYPT_E_NOT_FOUND)
At line:4 char:1
+ Get-Certificate -url https://cs.mytest.com/ADPolicyProvi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-Certificate], Exception
    + FullyQualifiedErrorId : System.Exception,Microsoft.CertificateServices.Commands.GetCertificateCommand

I am executing the command on the same machine as the test CS, to make sure there are no networking issues, and I'm logged in as a domain admin. the certificate server is running as a Standalone CA on Server 2016.

What am I missing? Which object is it complaining about?

powershell
windows-server
pki
asked on Stack Overflow Aug 3, 2019 by Will I Am

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0