PowerShell PKI Module Documentation

Documentation Home
This command is not available in non-domain environments
This command requires installed Remote Server Administration Tools (RSAT)

This command supports only Enterprise Certification Authorities

Add-CATemplate

Synopsis

Adds certificate templates to a list of templates to issue to a specified Certification Authority (CA).

Syntax

Add-CATemplate -InputObject <CATemplate[]> -DisplayName <String[]> [<CommonParameters>]

Add-CATemplate -InputObject <CATemplate[]> -Name <String[]> [<CommonParameters>]

Add-CATemplate -InputObject <CATemplate[]> -Template <CertificateTemplate[]> [<CommonParameters>]

Description

Adds certificate templates to a list of templates to issue by a specified Certification Authority (CA).

This command just prepares a new template list to be added to CA server. In order to write the new list to CA server use Set-CATemplate command (see examples).

Parameters

-InputObject <CATemplate[]>

Specifies the Certification Authority object with assigned templates. This object can be retrieved by running Get-CATemplate command.

Required? True
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? False

-DisplayName <String[]>

Specifies template (or templates) display names to assign to a specified CA server.

Required? True
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? False

-Name <String[]>

Specifies template (or templates) common names to assign to a specified CA server.

Required? True
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? False

-Template <CertificateTemplate[]>

Specifies template (or templates) object to assign to a specified CA server. Template object can be retrieved by running Get-CertificateTemplate command.

Required? True
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? False

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, InformationAction, InformationVariable,
WarningAction, WarningVariable, OutBuffer, PipelineVariable and OutVariable.
For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Inputs

PKI.CertificateServices.CATemplate

Outputs

PKI.CertificateServices.CATemplate

Notes

Examples

Example 1

PS C:\> Get-CertificationAuthority -Name "Company CA01" | Get-CATemplate | Add-CATemplate -Name "SmartCardV2","OfflineComputer" | Set-CATemplate

This command will add 'SmartCardV2' and 'OfflineComputer' templates (must be created by using Certificate Templates MMC snap-in by duplicating existing templates) and assigns them to a 'Company CA01' certification authority.

Example 2

PS C:\> Get-CertificationAuthority | Get-CATemplate | Add-CATemplate -DisplayName "Computer V2", "CA Exchange" | Set-CATemplate

This command will add templates with display names: 'Computer V2' (must be created by using Certificate Templates MMC snap-in by duplicating existing templates) and 'CA Exchange' and assigns them to all Enterprise CAs in the forest.

This example is useful to provide template redundancy, so clients are able to enroll for a certificate even if one CA server is down (offline).

Example 3

PS C:\> $Template = Get-CertificateTemplate -Name WebServer
C:\PS>Get-CertificationAuthority ca01.company.com | Get-CATemplate | Add-CATemplate -Template $Template | Set-CATemplate

In this example the first command retrieves template object by running Get-CertificateTemplate command. In the second line, adds this template to a CA server running on 'ca01.company.com' server.

Related links

Get-CertificationAuthority
Connect-CertificationAuthority
Get-CATemplate
Remove-CATemplate
Set-CATemplate
Get-CertificateTemplate

Minimum PowerShell version support

  • Windows PowerShell 3.0

Operating System Support

  • Windows 7
  • Windows 8
  • Windows 8.1
  • Windows 10
  • Windows 11
  • Windows Server 2008 R2 all editions
  • Windows Server 2012 all editions
  • Windows Server 2012 R2 all editions
  • Windows Server 2016 all editions
  • Windows Server 2019 all editions
  • Windows Server 2022 all editions