3

SEE IMAGE

I want to delete all my PERSONAL certificates from certmgr.msc from command line , is this possible? I tried some code but it doesnt work I can list my certificates by runing this in powershell

dir cert:\\CurrentUser\My\

I tried this but is not working

PS C:\Users\A\Desktop> rm cert:\\CurrentUser\My\0B909E44056411513E2B220007541AF4822B5C10
Remove-Item : Provider execution stopped because the provider does not  support this operation.
At line:1 char:3
+ rm <<<<  cert:\\CurrentUser\My\0B909E44056411513E2B220007541AF4822B5C10
+ CategoryInfo          : NotImplemented: (:) [Remove-Item], PSNotSupportedException
+ FullyQualifiedErrorId : NotSupported,Microsoft.PowerShell.Commands.RemoveItemCommand
jrtapsell
  • 1,176
  • 1
  • 10
  • 15
arlind
  • 43
  • 1
  • 7

1 Answers1

3

What OS and PowerShell version are you on? Your rm cert:\\CurrentUser\My\thumbprint example works on my machine.

The other way I would do it is via the pipeline. But ultimately, it's the same thing using Remove-Item.

gci cert:\CurrentUser\My | Remove-Item

The Remove-Item documentation indicates the ability to use it against certificates was added in PowerShell version 3.0.

Ryan Bolger
  • 16,755
  • 4
  • 42
  • 64