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

Remove-CATemplate

Synopsis

Removes certificate templates from list that can be issued by a specified Certification Authority (CA).

Syntax

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

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

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

Description

Removes certificate templates from the list that can be issued by a specified Certification Authority (CA).

This command actually 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 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 name to remove from 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 name to remove from 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 remove from 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 | Remove-CATemplate -Name "Machine","WebServer" | Set-CATemplate

This command will remove Machine and 'WebServer' templates from 'Company CA01' CA server. CA server will unable to issue any certificates based on specified templates.

Example 2

PS C:\> Get-CertificationAuthority | Get-CATemplate | Remove-CATemplate -DisplayName "Domain Controller" | Set-CATemplate

This command will remove Domain Controller template from all Enterprise CAs in the forest.

Example 3

PS C:\> $Template = Get-CertificateTemplate -DisplayName "Key Recovery Agent"
C:\PS>Get-CertificationAuthority ca01.company.com | Get-CATemplate | Remove-CATemplate -Template $Template | Set-CATemplate

In this example first command retrieves Key Recovery Agent template object. In the second line specified template will be removed from CA server running on ca01.company.com server.

Related links

Get-CertificationAuthority
Connect-CertificationAuthority
Get-CATemplate
Add-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