Quantcast
Channel: Public Key Infrastructure PowerShell module
Viewing all articles
Browse latest Browse all 729

Commented Unassigned: Blank CertificateTemplate field [55]

$
0
0
Hi,

I'm running the following command where __$IssuingCA__ is the FQDN of my Issuing CA.

```
Get-CertificationAuthority -computername $IssuingCA | Get-IssuedRequest -filter "NotBefore -ge $(get-date '6/13/2014 4:00:00 PM')" -property "CertificateTemplate"
```

Some of the returned certs have a blank in the CertificateTemplate field and some are correctly populated. When I look at the Certification Authority MMC, I can see that all my issued certs have a template associated with them. What might cause this discrepancy? How can I resolve this so the above command will properly retrieve the CertificateTemplate attribute for all my certs?

Thank you.
Comments: First, you don't need to explicitly specify CertificateTemplate column, because it is populated by default. Regarding empty value issue: looks like these certificates are issued by a deleted template. To work around this issue, you can manually edit Get-RequestRow.ps1 (in the Server folder) as follows: Find the following lines at the bottom (lines 76-78): ``` PowerShell if ($Cert.CertificateTemplate -match "^(\d\.){3}") { $cert.CertificateTemplate = ([Security.Cryptography.Oid]$Column.GetValue(1)).FriendlyName } ``` and replace them with the following: ``` PowerShell if ($Cert.CertificateTemplate -match "^(\d\.){3}") { if ([string]::IsNullOrEmpty(([Security.Cryptography.Oid]$Column.GetValue(1)).FriendlyName)) { $cert.CertificateTemplate = ([Security.Cryptography.Oid]$Column.GetValue(1)).Value } else { $cert.CertificateTemplate = ([Security.Cryptography.Oid]$Column.GetValue(1)).FriendlyName } } ``` this code will populate certificate template's object identifier for deleted templates.

Viewing all articles
Browse latest Browse all 729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>