So, you have a Client Id and a Client Secret, but don’t know if they work anymore? Maybe they are expired? Maybe someone removed them? No worries! We can use PowerShell to validate them easily!
By using PowerShell, it’s fairly straightforward to verify, that your Client Id and Client Secret work. See the snippets below for 2 different steps:
- First we validate, that the values work.
- If they don’t, let’s run another script to see if the Client Id exists but has expired.
Validate your Client Id by trying to connect with it
We can validate the Client Id and Secret, by using Connect-PnPOnline to connect to SharePoint Online.