Add Bulk Users To Shared Mailbox With Simple Powershell Script

MicrosoftExchange OnlinePowershell

In this article, we will see how to Add Bulk Users to Shared Mailbox. With step-by-step instructions and PowerShell scripts, this tutorial provides a seamless approach to efficiently handle user additions.

Preparing the CSV File

Open a Text Editor

Open a text editor such as Notepad.

Structure the Data

Create a “users.csv” file with a “Mailbox” column and list the users:

Mailbox
user1@example.com
user2@example.com
user3@example.com

Save the File

Save the file with the name “users.csv.” Ensure you select “All Files” as the file type to save it with the correct extension. Your csv will look like this.

Connecting to Exchange Online

Initiate a connection to Exchange Online using remote PowerShell.

Prerequisites:

Module Installation:

  1. Open PowerShell with administrator privileges.
  2. Run the following command to install the Exchange Online PowerShell Module:
Install-Module -Name ExchangeOnlineManagement

Connect Commands:

# Connect to Exchange Online
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://outlook.office365.com/PowerShell-LiveID/ -Authentication Basic -Credential $UserCredential
Import-PSSession $Session -DisableNameChecking

Add Bulk Users To Shared Mailbox

Execute the following PowerShell command to add users from the CSV file to the shared mailbox:

Import-Csv C:\shared.csv | ForEach-Object { 
    Add-MailboxPermission -Identity "shared@exmaple.com" -User $_.Mailbox -AccessRights FullAccess
}

Replace “shared@exmaple.com” with the actual email address of your shared mailbox.

Conclusion

With this straightforward PowerShell script, you’ve streamlined the process of adding multiple users to a shared mailbox in Exchange Online. This approach not only saves time but also provides a scalable solution for managing user access. Embrace the simplicity of PowerShell, making bulk user additions an effortless task in your collaborative environment. Enhance your administrative capabilities with this powerful tool and ensure smooth collaboration within your organization. Use script “Add Bulk Users To Shared Mailbox” to save your time!

Leave a Reply

Your email address will not be published. Required fields are marked *