
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Delete Windows Certificate Using PowerShell
To delete the Windows certificate using PowerShell, we can use the Remove-Item command.
Suppose you know the thumbprint of the certificate then to retrieve all the certificates that use that particular thumbprint, we will use the below command.
PS C:\> gci cert:\ -Recurse | where{$_.Thumbprint -eq
Output
To remove the certificates, we will pipeline the Remove-Item command.
PS C:\> gci cert:\ -Recurse | where{$_.Thumbprint -eq '920B033462B2FE268E6F9679F8621AEDC78D506C'} | Remove-Item -Force -Verbose
Output
Or if you have the Subject name, then instead of the Thumbprint property, you can use the subject name.
PS C:\> gci cert:\ -Recurse | where{$_.Subject -eq "DemoCert"} | Remove-Item -Force - Verbose
To remove the certificate on the remote servers, you can use the Invoke-Command.
Invoke-Command -ComputerName $Server -ScriptBlock{ gci cert:\ -Recurse | where{$_.Subject -eq "DemoCert"} | Remove-Item -Force -Verbose }
Advertisements