Created
July 13, 2020 19:43
-
-
Save ciphertxt/63612e6733a841e792f5e0c2799249e7 to your computer and use it in GitHub Desktop.
Find all Service Principals with credentials expiring in the next 60 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
az ad sp list \ | |
--all \ | |
--query "[?passwordCredentials[0].endDate<='$(date -d "+60 days" +%Y-%m-%d)'||keyCredentials[0].endDate<='$(date -d "+60 days" +%Y-%m-%d)'].{\"App ID Display Name\":appDisplayName,\"SP appId\":appId,\"Password Expiry Date\":passwordCredentials[0].endDate, \"Key Expiry Date\":keyCredentials[0].endDate}" \ | |
-o table |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment