Hello,
Is there a way to configure the Notification Email Address for all Azure Enterprise Applications with an SSO/SAML Configuration?
We want an internal sysadmin distribution list notified of all expiring SAML certificates, but this DL was not historically added to most of the Enterprise Apps when they were added. A number of the Enterprise Apps have a specific employee email address set, and some of these employees have left the company.
We have a script to report on all the certs expiring within 30 days (shown below), so we are good there, we just don't want to have to update the email on every single Enterprise App manually.
The setting is located here: Microsoft Azure Home / Enterprise Applications / %App Name% / Single Sign On / SAML Signing Certificate / Notification Email Address
Thank you.
$daysOut = 30
#Main Script#
$doneID = ""
$countExpiring = 0
$allSAMLApps = Get-AzureADServicePrincipal -All $true | Where-Object {($_.Tags -contains "WindowsAzureActiveDirectoryGalleryApplicationNonPrimaryV1") -or ($_.Tags -contains "WindowsAzureActiveDirectoryCustomSingleSignOnApplication")}
Write-Host "Looking for certs that expire by ((Get-Date).AddDays($daysOut))" -ForegroundColor Green
foreach ($singleApp in $allSAMLApps) {
foreach ($KeyCredential in $singleApp.KeyCredentials) {
if ( $KeyCredential.EndDate -lt (Get-Date).AddDays($daysOut) ) {
if (($singleApp.ObjectId) -ne $doneID) {
Write-Host " Name: " ($singleApp.DisplayName) " - Experation: " $KeyCredential.EndDate
$doneID = ($singleApp.ObjectId)
$countExpiring = $countExpiring + 1
}
}
}
}
Write-Host "There are $countExpiring certs." -ForegroundColor Green