The administration of a hybrid deployment that connects on-premises Exchange Server with Exchange Online, enabling seamless integration and centralized control.
Thank you for sharing your concern.
You could use this script:
$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.