Jump to content

delete all expired certificates


OnMyWay
 Share

Go to solution Solved by rudi,

Recommended Posts

Hi,
I need help with code to delete expired certificates in windows xp, and windows 7.
Due to the global expiration of let's encrypt in 2021 old computers that have not been updated will not be able to access the internet.
I found the command to import the new certificate, but not to delete the expired certificate!

Link to comment
Share on other sites

  • Solution

This is a task I would solve using powershell:

 

within an administrative powershell first list all expired certificates and check, if you will be fine to delte them all:

gci cert: -r |?{($($_.notafter) -lt $(get-date)) -and ($_.psiscontainer -eq $False)} | sort notafter -desc | ft notafter,subject

 

then delete them: (to do so "run as Admin" is required)

gci cert: -r |?{($($_.notafter) -lt $(get-date)) -and ($_.psiscontainer -eq $False)} | sort notafter -desc | remove-item -ea si

 

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...