1
Vote

Remove-CertificateTemplate cmdlet returns writeErrorException

description

I am using pspki version 3.2.6 on Server 2012 R2

I am attempting to remove a template that was previously imported to AD using the Import-CertificateTemplate.ps1 that Vadims published here: https://www.sysadmins.lv/blog-en/export-and-import-certificate-templates-with-powershell.aspx. This template imports without error and can be manually removed using the Certificate templates mmc.

I can view details of the template using the following:

Get-CertificateTemplate -displayname TestTemplate

When I attempt to delete the template I see the following error return:

PS C:\Users\Administrator> Get-CertificateTemplate -displayname TestTemplate | Remove-CertificateTemplate
Remove-CertificateTemplate : Unable to remove certificate template 'TestTemplate'
At line:1 char:44
  • Get-CertificateTemplate -displayname TestTemplate | Remove-CertificateTemplate
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Remove-CertificateTemplate
I have applied Full Control permissions to this template to ensure that this is not a Security issue. I believe this execution pattern matches the examples in the cmdlet. Any guidance on a pattern that allows this cmdlet to work would be greatly appreciated.

comments