Is there a command to query the Exchange Online server to get a list of users and the expiration date of their S/MIME certificate?
PS C:\WINDOWS\system32> Import-Module ExchangeOnlineManagement
PS C:\WINDOWS\system32> Connect-ExchangeOnline -UserPrincipalName [email protected]
PS C:\WINDOWS\system32> Get-Mailbox -SortBy Name | select Name,UserSMimeCertificate,UserCertificate
This lists the usernames and their S/MIME certificate. I need also the expiration date of their S/MIME certificate.
Thanks
I tried to reproduce the same in my environment.
Check the below way :
Also check boolean - Return true/false on property value in PowerShell, not the value - Stack Overflow
I donot have certifictaes for users and are empty.
or check like.
place $usercertificate.thumbprint for its -Thumbprint
Where format list gives properties like
NotAfterwhich is the expiration of certificate according to get-exchangecertificate description