Add-MailboxPermission - Identity "[email protected]" -User "<appid of the application>" -AccessRights FullAccess
The Add-MailboxPermission command is not recognized as a cmdlet, except that connect-exchangeonline needs to be run to connect to exchange online powershell module.
You also need to check that the account currently used to connect to the module has at least the Mail Recipient role.
You can check all roles of the user by referring to the following command:
Get-ManagementRoleAssignment -RoleAssignee <UserIdentity> -Delegating $false | Format-Table -Auto Role,RoleAssigneeName,RoleAssigneeType
-Identity "[email protected]"
Please note that the - Identity parameter of the Exchange PowerShell command supports user mailboxes, shared mailboxes, resource mailboxes, and so on in the Exchange environment.