Setting an inbox rule for a mailbox using PowerShell

I was talking to a US East Coast Higher Education institution yesterday that is currently in the process of rolling out Outlook Live.  They intend doing a hard switch over of the service behind the existing student email addresses, and one thing they also wanted to retain were redirection rules that the students had set up… they have all of the details for this on a per-address level.  This objective can be achieved through PowerShell scripting… what follows are the component commands to use.

In Outlook Live, inbox rules are set on a per-mailbox basis… and this is something that users would normally configure manually through Outlook 2007 or OWA.  An administrator can however grant themselves with access to a mailbox, and then proceed to set up rules on the end-user’s behalf.  In this example, I am using JennyA as the mailbox to configure, and Admin as the mailbox admin.  JennyA is redirecting her mail to her personal Hotmail account.

First of all, as an admin, you need to grant yourself full access rights to the mailbox:

add-MailboxPermission -Identity jennya -User admin -AccessRights fullaccess

Then add the new inbox rule to

new-inboxrule -name "Redirect to personal hotmail" -mailbox jennya -redirectto

You will see something like this:


Finally, remove the admin’s access rights

remove-MailboxPermission -Identity jennya -User admin -AccessRights fullaccess

So that is it…enjoy!



3 Responses to Setting an inbox rule for a mailbox using PowerShell

  1. Mike says:

    Is there a setting to have a maximum password length? We are running into this error when trying to reset a passwordPassword for member:"" is invalid. Please try with a password of a different length.

  2. US LiveAtedu says:

    There is no setting you can configure to set the maximum password length… here are the guidelines we set:

  3. Mike says:

    We have 1 user who cannot connect from Outlook 2007. Everyone else seems to be able to connect fine with the client. What settings should I check in PowerShell?

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: