Add user to multiple exchange additional mailboxes

Content of C:\PowerShell\mailboxes.lst:
email1@custom.com
email2@custom.com
email3@custom.com
Content of C:\PowerShell\add-user-to-mailboxes.ps1:
Get-Content c:\PowerShell\mailboxes.lst | Foreach-Object {
Add-MailboxPermission -Identity $_ -User usernamegoeshere -AccessRights FullAccess
Set-Mailbox -Identity $_ -GrantSendOnBehalfTo @{add='usernamegoeshere '}
}

No comments: