ymoon1972

Find Expired Test Certificates

Mar 21st, 2022 (edited)
33
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. // Find all certificates expected to expire within next 7 days
  3. //
  4. cluster("https://dsms.kusto.windows.net/")
  5. .database("dsms")
  6. .GetAKVCertificateInformation
  7. | where ServiceName contains "cpim"
  8. | where SecretType == "Certificate"
  9. | extend Expiration = todatetime(NotAfter)
  10. | extend CertName = split(Secret, "/")[-1]
  11. | where datetime_diff("day", Expiration, now()) <= 7
RAW Paste Data Copied