Hi @Amoz Tan,
Thank you for posting in this community.
To grant your Entra ID app read/write permissions to your SharePoint Online site after the recent changes to PnP PowerShell's -Interactive
parameter, you can still use the Grant-PnPAzureADAppSitePermission
cmdlet. This cmdlet allows you to add permissions for a given Microsoft Entra application registration.
Here's a general approach you can follow:
- Ensure that you have the
site.selected
permission granted in Entra ID. - Use the
Grant-PnPAzureADAppSitePermission
cmdlet to assign the necessary permissions. The syntax would look like this:
Grant-PnPAzureADAppSitePermission -AppId {client-id} -DisplayName {display-name} -Permissions ReadWrite -Site {site-object}
Replace {client-id}
, {display-name}
, and {site-object}
with your application's client ID, a description for the application, and the site object respectively.
- If you need to manage or revoke permissions later, you can use the
Set-PnPAzureADAppSitePermission
andRevoke-PnPAzureADAppSitePermission
cmdlets.
Make sure to connect to your SharePoint site using Connect-PnPOnline
before executing these commands.
Reference: Granting permissions via PnP PowerShell.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.