0

I am trying to display expiring SSO ADFS certificates and want to sort them by the date of expiration. Right now it is currently sorting by name. I am not familiar with these functions so any advice helps:

$Trusts = Get-AdfsClaimsProviderTrust |
Select name, @{Name='TokenSigningCertificates'; Expression={[string]::join(";", ($_.TokenSigningCertificates.NotAfter| 
Group-Object Name | 
Foreach-Object {$_.Group | Sort-Object * | Select-Object -Last 1}))}} |
Sort-Object -Property name

Result:

enter image description here

I want the list to show the first expiring at the beginning

0 Answers0