The documentation is permanently moved. New URL to the command description: Get-CATemplate

Last edited Apr 4, 2016 at 6:48 AM by Camelot, version 8

Comments

takmiuwang Apr 7, 2015 at 5:34 PM 
v3.1 on 2012 Rs server - CA and AD on same machine.

Played with Get-CATemplate and got this error:

==============================================
PS C:\Windows\system32> Get-CertificationAuthority -Name W2K12-CA

DisplayName ComputerName IsAccessible ServiceStatus Type
----------- ------------ ------------ ------------- ----
W2K12-CA w2k12-64.w2k12.com True Running Standalone Root CA


PS C:\Windows\system32> Get-CertificationAuthority -Name W2K12-CA | Get-CATemplate
New-Object : Exception calling ".ctor" with "1" argument(s): "Operation is not supported on this platform."
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\pspki\Server\Get-CATemplate.ps1:14 char:4
+ New-Object PKI.CertificateServices.CATemplate -ArgumentList $CA
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

PS C:\Windows\system32> Get-CATemplate -CertificationAuthority W2K12-CA
Get-CATemplate : Cannot process argument transformation on parameter 'CertificationAuthority'. Cannot convert value "W2K12-CA" to type
"PKI.CertificateServices.CertificateAuthority[]". Error: "Cannot convert value "W2K12-CA" to type "PKI.CertificateServices.CertificateAuthority". Error:
"Specified Certification Authority 'W2K12-CA' is unavailable.""
At line:1 char:40
+ Get-CATemplate -CertificationAuthority W2K12-CA
+ ~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Get-CATemplate], ParameterBindingArgumentTransformationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-CATemplate

PS C:\Windows\system32>
======================================

What did I do wrong?

EBrant Sep 18, 2013 at 3:16 PM 
Hello,

I am having an issue with Get-CATemplate as follows

first

$CA = Get-CertificationAuthority -Name MyEntDomainCA

$CA.GetType()

IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True False CertificateAuthority System.Object

Then



$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
Ernie