Skip to content

Get-ClientSecrets.ps1 - Doesn't handle duplicate credentials. #1

@devSpart

Description

@devSpart

Hey, firstly I love these scripts, they helped me do a long overdue audit on a particular tenant!

Just wanted to contribute to these scripts as I've modified the credential one to handle duplicate credentials on an app.
If a credential has expired and there's another one been created without the expired one being deleted, it only reports on the very first credential (expired one). This goes for any scenario where there's 2 or more sets of credentials per each app. It will always only report on the first one ever created.

I've attached my modified script so you can run and review it. I've also split out the csv columns as follows:
DisplayName | AppID | AppCredentialID | AppCreated | AppExpires | SPCredentialID | SPCreated | SPExpires
This helped me read it a bit better as I was having trouble reading all the credential details when they were part of one column.

Hope you find this useful, keen for your feedback let me know if you have any other ideas you've been struggling with I'm happy to see if I can help.

Cheers!

Get-ClientSecrets_v3.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions