Hello everyone,
does someone have an idea how to get the expiration date by Powershell or REST?

I would rather get some notification by our monitoring before it expires than by the users after it expired and they can't log on any more...
Hello hoppe,
Thank you for your question.
Devolutions Server can already warn you before the secret expires.
Since version 2025.3.10.0, it displays a warning banner and emails alerts to administrators as the secret expiration date on the Microsoft Authentication page approaches.
From your screenshot, your server is recent enough to include this.
For your own monitoring, I recommend reading the date from Entra ID directly, where the secret itself is kept.
By REST, the Microsoft Graph "Get application" request, which accepts your app registration's client ID, returns its passwordCredentials, and the endDateTime of each one is the expiration date of that secret, in UTC.
By PowerShell, Get-MgApplication from the Microsoft Graph PowerShell module returns the same PasswordCredentials with their EndDateTime.
Microsoft publishes a sample script that lists every secret expiring within the number of days you choose, with its end date, on its Learn page "PowerShell sample: Export app registrations with expiring secrets and certificates".
For an unattended monitoring app, Microsoft lists Application.Read.All as the least privileged permission for this read.
When you renew the secret, create the new one in the app registration, paste its value in the Secret value field of the Microsoft Authentication page with its new expiration date, and click Save.
Delete the old secret in Entra ID only once sign-in works with the new one.
https://docs.devolutions.net/server/kb/how-to-articles/configure-microsoft-authentication-with-entra-id/
Let me know if you have any questions.
Best regards,
Patrick Ouimet