Managing Office 365 mail with PowerShell

Like: Now you can add resource mailboxes through the new Office 365 UI

Dislike: They seem to have removed the ability to manage secondary proxy addresses through the UI.

So. To setup the connection to manage mailboxes through PowerShell, do the following:

  • $cred= Get-Credential (Enter your organizational account details in the dialog box)
  • $s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication basic -AllowRedirection
  • Import-PSSession $s

There we go, cmdlets available. Now, to set addresses, do:

  • Set-Mailbox <email> -EmailAddresses SMTP:primaryaddress@company.com, smtp:secondaryaddress@company.com, smtp:tertiaryaddress@company.com

(Uppercase SMTP denotes a primary address)

To allow a user to access this mailbox, do:

  • Add-MailboxPermission -Identity <mailbox> -User <user to access mailbox> -AccessRights FullAccess

To allow a user to send from a mailbox:

  • Add-RecipientPermission <mailbox> -AccessRightsSendAs -Trustee <user>

(This is the same as the on-prem Add-ADPermission <mbx> -User <user> -ExtendedRights SendAs)

(Thanks to Peter Schmidt @ msdigest.net)

Advertisements
This entry was posted in Aide memoire, Email, Powershell and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s