Can New-PartnerCustomerApplicationConsent grant application scope permissions for users/{id|userPrincipalName}/mailboxSettings/UserPurpose
Robert Cook
20
Reputation points
Hi,
I am using the following to grant consent on behalf of for multiple customers but it sets the permissions type as delegated in the application. I need to grant application permissions, is this possible or is there another method I can use for multiple customers?
This is so I can query https://graph.microsoft.com/v1.0/users/{id|userPrincipalName}/mailboxSettings/userPurpose which from what I can tell needs application scope (only /me/mailboxSettings/userPurpose will work with delegated scope).
$PartnerCenter = Connect-PartnerCenter -AccessToken $PartnerAccessToken.AccessToken
$MSGraphgrant = New-Object -TypeName Microsoft.Store.PartnerCenter.Models.ApplicationConsents.ApplicationGrant
$MSgraphgrant.EnterpriseApplicationId = "00000003-0000-0000-c000-000000000000"
$MSGraphgrant.Scope = "MailboxSettings.Read"
$ExOgra
New-PartnerCustomerApplicationConsent -ApplicationGrants @($MSGraphgrant) -CustomerId $CustomerTenantId -ApplicationId $AppId -DisplayName $AppDisplayName
Sign in to answer