Error when using Get-CATemplate

Sep 23, 2013 at 3:06 PM

I am having an issue with Get-CATemplate as follows


$CA = Get-CertificationAuthority -Name MyEntDomainCA


IsPublic IsSerial Name BaseType

True False CertificateAuthority System.Object


$CA | Get-CATemplate

New-Object : Exception calling ".ctor" with "1" argument(s): "Unknown error (0x80005000)"
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSPKI\Server\Get-CATemplate.ps1:14 char:14
  • New-Object <<<< PKI.CertificateServices.CATemplate -ArgumentList $CA
  • CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
  • FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
Can anyone shed some light on the above please and how to resolve

I only have one instance of the PSPKI v2.6 loaded on Windows 2003 R2 CA with PowerShell v2

Thanks All
Sep 23, 2013 at 3:07 PM
I have also tried

Get-CATemplate -CertificationAuthority $ca

Same result,

Thanks All
Sep 23, 2013 at 7:13 PM
Can you install PSPKI module on another computer (which is not Windows XP or Windows Server 2003) and check whether the command fails. I just looked the code and it looks like your error is not raised by my code, but instead by underlying ICertAdmin::GetCAProperty method.

also, it seems like that latest module version breaks certificate template support when running on Windows XP or Windows Server 2003 (although, it is not directly related to your issue). The issue is due to incompatible (which is compateible with all newer OS versions) structure is used for OID enumeration.