brink668
brink668

Reputation: 665

Delete certificate from Computer Store

I am having difficulty getting powershell to delete a certificate that was accidentally installed to all our Windows 7 machines to the Computer Store.

As an example I have included a screen shot of where the certificate is installed (this is not the actual certificate). We have a few hundred machines so we would like to do this as automatic as possible.

If someone could provide a way to delete the certificate by Serial Number or Thumbprint that would be great.

enter image description here

Upvotes: 51

Views: 110201

Answers (1)

Frode F.
Frode F.

Reputation: 54981

You can use the Cert:-PSDrive with Get-ChildItem and Remove-Item. Ex:

#Delete by thumbprint
Get-ChildItem Cert:\LocalMachine\My\D20159B7772E33A6A33E436C938C6FE764367396 | Remove-Item

#Delete by subject/serialnumber/issuer/whatever
Get-ChildItem Cert:\LocalMachine\My |
Where-Object { $_.Subject -match 'Frode F' } |
Remove-Item

Upvotes: 93

Related Questions