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.
Press Windows Key + R Key together, type certmgr. msc, and hit enter. You will get a new window with the list of Certificates installed on your computer. Locate the certificate you want to delete and then click on the Action button then, click on Delete.
To delete the Windows certificate using PowerShell, we can use the Remove-Item command.
To uninstall a certificate from a remote computer, use the `Session`parameter, which was added in Carbon 2.1. 0. You can create a new session with the `New-PSSession` cmdlet. You can uninstall a certificate using just its thumbprint (this functionality is new in Carbon 2.5.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With