How to manage guest access in Microsoft 365 mailboxes?
+
Granting guest access to Microsoft 365 mailboxes is essential for enabling external collaborators to work efficiently with internal teams. However, it’s crucial to manage these permissions to prevent unauthorized access and compliance issues.
Let's see how to effectively manage guest access to user mailboxes in Exchange Online using PowerShell.
- Ensure you connect to the Exchange Online PowerShell module before proceeding.
- Full Access permission allows a guest user to open and fully manage a mailbox. However, it does not include Send As or Send on Behalf Of permissions. To grant 'Full Access' permission, run the following cmdlet by replacing <UserName> with the UPN of the mailbox and <GuestUser> with the guest user's UPN.
Add-MailboxPermission –Identity "<UserName>" -User "<GuestUser>" -AccessRights FullAccess -InheritanceType All
- Send As permission allows a guest user to send emails as the mailbox owner. To provide 'Send As' access, execute the cmdlet below by replacing <GuestUser> with the guest user's UPN and <UserMailbox> with the target mailbox's UPN.
Add-RecipientPermission –Identity "<UserMailbox>" -Trustee "<GuestUser>" -AccessRights SendAs
- Send on Behalf of permission lets a guest user send emails on behalf of the mailbox owner. To assign this permission, execute the cmdlet below.
Set-Mailbox "<UserMailbox>" -GrantSendOnBehalfTo @{Add="<GuestUser>"}
If you want to grant guest access to a shared mailbox, replace <UserMailbox> with the UPN of the shared mailbox in the above commands. This ensures that external users have the right access to perform their roles effectively in a shared mailbox.
You can also remove any permissions granted to guest users using the following PowerShell cmdlets.
- Remove-MailboxPermission: This cmdlet is used to remove 'Full Access' permission delegated.
- Remove-RecipientPermission: Using this cmdlet, you can remove 'Send As' permission delegated.
- Set-Mailbox: This cmdlet can also be used to revoke 'Send on Behalf of' permissions. However, the value for GrantSendOnBehalfTo must be modified.
For example, to remove Send on Behalf of permission granted to a guest user, run the following cmdlet
Set-Mailbox "<UserMailbox>" -GrantSendOnBehalfTo @{Remove="<GuestUser>"}