Check Certificates. Remote Computer. Powershell.

Certificate expiry poses a problem for many a administrator. There are many monitoring tools and techniques, however using a periodic interval, I like to check this manually.

I do this using the following exert from one of my scripts.
Limiting the collection of computer names to a text file is how I like to keep things consistent.

get-content computers.txt | foreach {Invoke-Command -ComputerName $_ -ScriptBlock {Get-ChildItem Cert:\LocalMachine\My | Where {$_.NotAfter -lt (Get-Date).AddDays(65)} | select subject, thumprnint, notafter}}

Note: Winrm will need to be enabled.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s