(Related to this question)
I have an application that should be automatically usable for all customer tenants, and therefore tried this tutorial to enable preconse
In order to query the MS Graph, your app will need to be granted the appropriate permissions by an end user or by an administrator of the tenant. Usually the best way to acquire consent from an administrator is by using the prompt=admin_consent
parameter, as you've done above.
If for some reason you must do so via powershell, you can create an oAuth2PermissionGrant object using a consentType
of AllPrincipals
.
Personally I wouldn't recommend using the recordConsentConditions
property. It's only there for legacy reasons - I don't even know what it does.