Checking certificate expiration with PowerShell

Had an idea to write some (PowerShell) script which will check and maybe notify me of certificates that are nearing expiration for a bunch of (public) sites that… somewhat matter to me. 😊

As it turns out, someone already had this idea and wrote very nice PowerShell script that does just that, available here – thank you!

While testing it, there were sites on which the script worked just fine, and there were sites on which I got errors like this one (Error: “String was not recognized as a valid DateTime.”):

Seems to be connected to my regional settings (I know… who would ever use hr-HR instead of en-US, but… 😊) and date/time formatting:

I’ve tried to fix it in a couple of ways, but the one that finally did it (for me) was explained on Dan Sheehan’s blog (thanks!), implemented on lines 25-26 below.

So, my adapted script looks like this (and works with my hr-HR culture):

It provides the following output (which can be further customized per your needs, of course… and I know – need to insert some line breaks, convert output to HTML, send it via e-mail, … it’s a start! 😊):

Note that I’m returning expiration date “the Croatian way”, by using the following formatting:

Hope it helps someone (and #kudos to original authors)!

Cheers!

Windows 7, WebUG…

windows7ultimate_thumb Danas je (konačno) stigao Windows 7 Ultimate CRO kojeg sam spominjao u jednom od prethodnih postova. Za sve koje zanima – radi se o retail verziji (dakle, u lijepoj, crnoj kutiji :)).

Mislim da ga neću još otvarati (nekako mi je žao… :)). U svakom slučaju – još jednom HVALA Microsoftu (i na prilici da budem dio beta testing tima i na poklonu).

Maloprije sam stigao iz Zagreba gdje je održan prvi sastanak WebUG – zajednice web developera.

S obzirom da je već objavljen rezime sastanka, neću prepisivati; jedino bih spomenuo da mi je drago da su i web developeri dobili svoju grupu – mjesto na kojem mogu razmjenjivati iskustva, znanje, ideje i ostalo…

Croatian Windows 7 Ultimate Edition

windows-7-ultimate Danas me u mailboxu dočekalo ugodno iznenađanje koje mi je Microsoft priredio – kako sam sudjelovao u beta testiranju lokalizirane verzije Windows 7 OS-a, obavješten sam da će mi poslati kopiju konačne verzije softvera koji smo testirali…

Zaista, lijep način zahvale za trud oko testiranja i ugodno iznenađenje – Thank you Microsoft!