How to assign full access permission of shared mailbox in bulk
Introduction
This script is used to help administrator to assign the full access permission of a shared mailbox to the organization mailbox or a single mailbox.
Scenarios
This script is used to help administrator to assign the full access permission of a shared mailbox to the organization mailbox or a single mailbox..
Script
You can use this script in the following way.
1. Open Windows PowerShell.
2. Type the one command< Script Path> at the Windows PowerShell Console.
For example, type C:\Script\ GrantFullAccessToSharedMailbox.ps1
Here are some code snippets for your references.
$BoxList = Get-Mailbox -RecipientTypeDetails UserMailbox
foreach($mailbox in $BoxList)
{
Add-MailboxPermission -identity $SharedMailbox -user $Mailbox.PrimarySmtpAddress -AccessRights FullAccess -InheritanceType all
}
$BoxList = Get-Mailbox -RecipientTypeDetails UserMailbox
foreach($mailbox in $BoxList)
{
Add-MailboxPermission -identity $SharedMailbox -user $Mailbox.PrimarySmtpAddress -AccessRights FullAccess -InheritanceType all
}
Examples
Example: Assign all user mailboxes in organization the full access permission of the shared mailbox.
The sample is showed below
GrantFullAccessToSharedMailbox.ps1 -Credential $credential -SharedMailbox ShareMailbox@contoso.com –All
Example: assign the mailboxes User@contoso.com the full access permission of the shared mailbox.
The sample is showed below
GrantFullAccessToSharedMailbox.ps1 -Credential $credential -SharedMailbox ShareMailbox@contoso.com -SingleMailbox User@contoso.com
Prerequisites
Exchange Online
Windows PowerShell 2.0crosoft All-In-One Script Framework is an automation script sample library for IT Professionals. The key value that All-In-One Script Framework is trying to deliver is Scenario-Focused
Script Samples driven by IT Pros' real-world pains and needs. The team is monitoring all TechNet forums, IT Pros' support calls to Microsoft, and script requests submitted to TechNet Script Repository. We collect frequently asked IT scenarios, and create script
samples to automate the tasks and save some time for IT Pros. The team of All-In-One Script Framework sincerely hope that these customer-driven automation script samples can help our IT community in this script-centric move.