Delen via


Apply a sharing policy to mailboxes in Exchange Online

Sharing policies control how your users share their calendars with people outside your organization. The sharing policy that an admin applies to the user's mailbox determines what level of access a user can share and with whom. If you don't change anything, then all users can invite anyone with an email address to view their calendar. If you create a new sharing policy, you have to apply that policy to mailboxes before it takes effect. Sharing policies are applied to individual user's mailboxes. An admin can also disable a user's sharing policy to prevent external access to calendars.

What do you need to know before you begin?

Use the Exchange admin center to apply a sharing policy to one mailbox

  1. From the Microsoft 365 admin center dashboard, click Exchange.

  2. Go to Recipients > Mailboxes.

  3. On the Manage mailboxes page, select an individual mailbox by clicking anywhere in the row other than the button option that appears in the blank area next to the Display name column.

  4. In the User Mailbox details flyout that opens, click > Mailbox > Manage mailbox policies.

  5. Under Sharing policy, select the sharing policy you want to apply to this mailbox.

  6. Click Save to apply the sharing policy.

Use the Exchange admin center to apply a sharing policy to multiple mailboxes

  1. From the Microsoft 365 admin center dashboard, click Exchange.

  2. Go to Recipients > Mailboxes.

  3. On the Manage mailboxes page, select the mailboxes and click Mailbox policies.

  4. In the details flyout that opens, the Mailbox policies will be configured for bulk edit.

  5. Under Sharing Policy, select the sharing policy from the list.

  6. Click Save to apply the sharing policy.

Use Exchange Online PowerShell to apply a sharing policy to one or more mailboxes

This example applies the sharing policy Contoso to Barbara's mailbox.

Set-Mailbox -Identity Barbara -SharingPolicy "Contoso"

This example finds all user mailboxes in the Marketing department and then applies the sharing policy Contoso Marketing.

Get-Mailbox -Filter "Department -eq 'Marketing'" | Set-Mailbox -SharingPolicy "Contoso Marketing"

This example shows all mailboxes that have the sharing policy Contoso applied, and it sorts the users into a table that displays only their aliases and email addresses.

Get-Mailbox -ResultSize unlimited | Where {$_.SharingPolicy -eq "Contoso"} | format-table Alias,EmailAddresses

For detailed syntax and parameter information, see Set-Mailbox and Get-Mailbox.

How do you know this worked?

To verify that you have successfully applied the sharing policy to a user mailbox, do one of the following:

  • In the Exchange admin center, go to Recipients > Mailboxes, and then select the mailbox to which you applied the sharing policy. Click Edit Edit icon., click mailbox features, and then confirm that the correct sharing policy displays in the Sharing policy.

  • Run the following command to verify the sharing policy was assigned to a user mailbox. Verify that the correct sharing policy is listed for the SharingPolicy parameter.

    Get-Mailbox <username> | format-list