PSPKI
PSPKI copied to clipboard
Get-CATemplate throws an error "New-Object : Exception calling ".ctor" with "1" argument(s): "There is no such object on the server."
It looks similar to #160
PS C:\Users\QQQ> Get-CertificationAuthority | Get-CATemplate -Debug
New-Object : Exception calling ".ctor" with "1" argument(s): "There is no such object on the server.
"
At C:\Users\QQQ\Documents\WindowsPowerShell\Modules\PSPKI\3.7.2\Server\Get-CATemplate.ps1:14 char:4
+ New-Object PKI.CertificateServices.CATemplate -ArgumentLi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
I think this is a different issue. The error is thrown from LDAP accessor. It may indicate that CA has assigned a certificate template which no longer exist in Active Directory. If you open your CA in MMC and navigate to Certificate Templates folder you should see a template with red cross on template icon.
I've just checked. No, I don't have a red cross over our assigned template's icons
then it is something with AD. Here is where CATemplate
attempts to find the certificate template in AD: https://github.com/PKISolutions/pkix.net/blob/f77ec6d1e4d23ac87a6a427b835724839b10f856/PKI/CertificateServices/CATemplate.cs#L77 and the exception is most likely thrown there.
Closed as non-reproducable.