Last active
April 25, 2017 12:38
-
-
Save DarranShepherd/4ddc992b64f899d18b1d0d7560121755 to your computer and use it in GitHub Desktop.
List service principal certificates expiring in the next 7 days
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-AzureRmADApplication |% { | |
$app = $_; | |
Get-AzureRmADAppCredential -ApplicationId $_.ApplicationId ` | |
| Where-Object { $_.Type -eq "AsymmetricX509Cert" -and (Get-Date $_.EndDate) -lt (Get-Date).AddDays(7) } |% { | |
Write-Host "Cert for application $($app.DisplayName) ($($app.ApplicationId)) expires on $($_.EndDate)" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment