How to find certificates that are expiring on your server using PowerShell– Part 1

Home > Blogs > PowerShell > How to find certificates that are expiring on your server using PowerShell– Part 1

How to find certificates that are expiring on your server using PowerShell– Part 1

Like This Blog 2 Jason Helmick
Added by January 14, 2013

So, I’m often asked how to quickly find certificates that are about to expire so that they can be replaced. Here is a quick way to list the days remaining before the certificates on your server are about to expire.

PS> Get-ChildItem -Path Cert:\LocalMachine\My | Select-Object -Property PSComputerName, Subject, @{n=’ExpireInDays’;e={($_.notafter – (Get-Date)).Days}}

By adding a Where-Object filter, you can filter the list so that only certificates that are going to expire in 90 days are displayed.

PS> Get-ChildItem -Path Cert:\LocalMachine\My | Select-Object -Property PSComputerName, Subject, @{n=’ExpireInDays’;e={($_.notafter – (Get-Date)).Days}} | Where-Object {$_.ExpireInDays -lt 90}

If you have multiple servers such as a web farm, you can use PowerShell Remoting to check all your servers at once! Check out the same one-liners using PowerShell remoting Locating IIS certificates before the expire.

Pretty cool huh?

For more, read Part 2: How to find certificates that are expiring on your server using PowerShell

Knowledge is PowerShell

Jason Helmick
Director of PowerShell Technologies
Interface Technical Training

Videos You May Like

Agile Methodology in Project Management

0 153 0

In this video, you will gain an understanding of Agile and Scrum Master Certification terminologies and concepts to help you make better decisions in your Project Management capabilities. Whether you’re a developer looking to obtain an Agile or Scrum Master Certification, or you’re a Project Manager/Product Owner who is attempting to get your product or … Continue reading Agile Methodology in Project Management

Creating Users and Managing Passwords in Microsoft Office 365

0 642 3

In this Office 365 training video, instructor Spike Xavier demonstrates how to create users and manage passwords in Office 365.   For instructor-led Office 365 training classes, see our course schedulle: Spike Xavier SharePoint Instructor – Interface Technical Training Phoenix, AZ 20347: Enabling and Managing Office 365    

Detailed Forensic Investigation of Malware Infections – April 21, 2015

4 606 5

How does an investigator hunt down and identify unknown malware? In this recording of our IT Security training webinar on April 21, 2015, Security expert Mike Danseglio (CISSP / CEH) performed several malware investigations on infected computers and identify symptoms, find root cause, and follow the leads to determine what’s happening. He demonstrated his preferred … Continue reading Detailed Forensic Investigation of Malware Infections – April 21, 2015

Write a Comment

See what people are saying...

  1. Avatar Matt Markley
  2. Avatar JJ Perez

    Jason, I really wanted to read the remoting one liner article but link is broken , Can you post somewhere please?

Share your thoughts...

Please fill out the comment form below to post a reply.