$AllCertificates = Get-ChildItem -Path Cert:\LocalMachine\My -Recurse
# Create an empty list to keep the results
$CertificateList = @()
ForEach ( $Certificate in $AllCertificates )
{
# Check to see if this is a "folder" or a "certificate"
if ( -not ( $Certificate.PSIsContainer ) )
{
# Certificates are *not* containers (folders)
# Get the important details and add it to the $CertificateList
$CertificateList += $Certificate | Select-Object -Property FriendlyName, Issuer, Subject, Thumbprint, NotBefore, NotAfter
}
}
$CertificateList
I would like to update this so that:Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.
TRUSTED BY
Just FYI, "NotBefore" is NOT the same as "Issued On". A cert can be issued long before it becomes valid. That's why it's called "NotBefore". A better phrase might be "Valid From" and "Valid To".
Open in new window