Mailbox permissions

Glenn Maxwell 14,166 Reputation points
2026-07-11T22:31:42.69+00:00

Hi I am using exchange SE hybrid environment. I have a room mailbox (resource mailbox) in Exchange Online, This room mailbox is created as remote mailbox from exchange onprem, for example room1[@]contoso.com is room maibox.

I have a CSV file containing 5 users, and I need to grant each of them the following permissions on the room mailbox:

  • Full Access
  • Send As
  • Send on Behalf
  • Editor access to the room mailbox calendar

Could someone please provide a PowerShell script to assign these permissions to all users listed in the CSV?

My CSV file is in the following format:

Users 
user1[@]contoso.com 
user2[@]contoso.com 
user3[@]contoso.com
Exchange | Hybrid management
Exchange | Hybrid management

The administration of a hybrid deployment that connects on-premises Exchange Server with Exchange Online, enabling seamless integration and centralized control.

0 comments No comments

Answer accepted by question author

Hin-V 16,830 Reputation points Microsoft External Staff Moderator
2026-07-11T23:18:51.46+00:00

Hi @Glenn Maxwell

Thank you for sharing your concern. 

You could use this script: 

Connect-Exchange Online

$RoomMailbox = "your room mailbox"   
$CsvPath     = "your CSV path"  
# ============================== 
# Import users (robust method) 
# ============================== 
if (-not (Test-Path $CsvPath)) { 
    Write-Error "CSV file not found: $CsvPath" 
    return 
} 
  
# Read all lines, skip header/empty lines, extract email addresses 
$Users = Get-Content $CsvPath -Encoding UTF8 | 
         Where-Object { $_ -match '@' -and $_.Trim() -ne '' } | 
         ForEach-Object { $_.Trim() } 
  
if ($Users.Count -eq 0) { 
    Write-Error "No email addresses found in the CSV file!" 
    return 
} 
  
Write-Host "Found $($Users.Count) users. Starting to assign permissions on room mailbox: $RoomMailbox" -ForegroundColor Cyan 
Write-Host "" 
  
foreach ($User in $Users) { 
    Write-Host ">>> Processing: $User" -ForegroundColor Yellow 
  
    try { 
        # 1. Full Access 
        Add-MailboxPermission -Identity $RoomMailbox ` 
                              -User $User ` 
                              -AccessRights FullAccess ` 
                              -InheritanceType All ` 
                              -AutoMapping $false ` 
                              -ErrorAction Stop | Out-Null 
        Write-Host "  [OK] Full Access" -ForegroundColor Green 
  
        # 2. Send As 
        Add-RecipientPermission -Identity $RoomMailbox ` 
                                -Trustee $User ` 
                                -AccessRights SendAs ` 
                                -Confirm:$false ` 
                                -ErrorAction Stop | Out-Null 
        Write-Host "  [OK] Send As" -ForegroundColor Green 
  
        # 3. Send on Behalf 
        Set-Mailbox -Identity $RoomMailbox ` 
                    -GrantSendOnBehalfTo @{Add=$User} ` 
                    -ErrorAction Stop | Out-Null 
        Write-Host "  [OK] Send on Behalf" -ForegroundColor Green 
  
        # 4. Calendar Editor 
        Add-MailboxFolderPermission -Identity "$RoomMailbox`:\Calendar" ` 
                                    -User $User ` 
                                    -AccessRights Editor ` 
                                    -ErrorAction Stop | Out-Null 
        Write-Host "  [OK] Calendar Editor" -ForegroundColor Green 
    } 
    catch { 
        Write-Warning "  Failed for $User : $($_.Exception.Message)" 
    } 
  
    Write-Host "" 
} 
  
Write-Host "Completed!" -ForegroundColor Cyan 

Please give it a try and let me know if this helps. 

If you have any additional concerns, feel free to comment below. I would be more than happy to assist. 


Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.  

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.