Find Expiring Certificates Using PowerShell – One-Liner and a Script

This code is not really complicated at all. Just the same it can come in very handy, and some folks have never played with the Certificate provider. I have provided a one-liner version of this code, and a script version. They are basically the same, but certainly the script one is considerably more verbose and easy to read.

A note for the advanced: I have not yet been able to figure out if there is a way that you can construct the .Net objects that are instantiated here, but bind them to certificates on remote machines. When I looked at the MSDN documentation for this, I don't see a constructor for a remote machine. I still suspect there is a way to do, I just don't know it right now. If anyone knows it, contact me and I will be happy to write another post explaining how to use it…once I figure it out 🙂