Category Archives: Office 365

Enabling an Office 365 Archive Mailbox with PowerShell (Exchange Online)

In the post below, I will cover two methods on how to enable an Archive Mailbox in Office 365 (Exchange Online) using PowerShell. The first method will be a straight forward non-hybrid deployment where the archive is enabled in Exchange Online and the second method will be a hybrid deployment of Exchange with Exchange Online, where the archive mailbox value must be set on premise and synchronized to Exchange Online, where the archive mailbox is enabled. The first thing to do is to make sure that the Office 365 license assigned to the user has the Archive option included.

Non-Hybrid Deployment

Use this Microsoft KB article for more detailed scenarios.

https://technet.microsoft.com/en-us/library/jj984357(v=exchg.150).aspx

Connect to Exchange Online with PowerShell

Use the Enable-Mailbox command to activate the archive

  1. Enable-Mailbox <User Name or Email Address> -Archive

Verify the archive is enabled

  1. Get-Mailbox <User Name or Email Address> | Format-List Name,*Archive*

Hybrid Deployment of Exchange On-Premise and Exchange Online (Office 365)

Because of the hybrid setup of Exchange and the fact that local AD is being synchronized to Azure AD, we need to set the archive value in on-premise AD and let DirSync or AD Connect synchronize the value to Azure AD to enable the archive mailbox in Exchange Online.

Use these Microsoft KB articles for more details.

https://technet.microsoft.com/en-us/library/jj614563.aspx

https://blogs.technet.microsoft.com/rmilne/2015/04/30/enable-remote-archive-with-exchange-hybrid/

Open the local version of Exchange Management Shell

Use the Enable-RemoteMailbox command with the -Archive switch to activate the Archive mailbox in Exchange Online

  1. Enable-RemoteMailbox <User Name or Email Address> –Archive

Synchronize local AD with Azure AD (scheduled or manual) (DirSync or AD Connect)

Verify the archive is enabled

  1. Connect to Exchange Online with PowerShell
  2. Get-Mailbox <User Name or Email Address> | Format-List Name,*Archive*

Mail Routing – G Suite to Office 365 (Exchange Online EOP)

During my day job, I get a lot of requests on how to migrate from G Suite to Office 365. BitTitan MigrationWiz can take care of the mailbox and free/busy co-existence, but G Suite and Office 365 will handle the mail routing. The post below will cover how to setup mail routing assuming that mail is still being delivered to G Suite and the mail boxes are being migrated to Office 365.

Use this KB from Microsoft to learn about Criteria Based Routing in EOP

https://technet.microsoft.com/en-CA/library/exchange-online-mail-flow.aspx

BitTitan has a great article on how to setup Criteria Based Routing for a migration scenario.

https://community.bittitan.com/kb/Pages/How%20to%20set%20up%20mail%20routing%20on%20Office365%20when%20migrating%20users%20in%20batches.aspx

G Suite Setup
SMTP Domain Type Mail Routing (MX Points Here)
contoso.com Primary Domain YES

There are no domains to be setup for G Suite. We use the primary domain already added and verified in G Suite

Office 365 (Exchange Online)
SMTP Domain Type Mail Routing (MX Points Here)
contoso.com Primary Domain NO – G Suite
tenantid.onmicrosoft.com Tenant Domain YES

External Email Delivery


Mail Routing – New/Reply from Office 365 (Internal and External)


Mail Routing – New/Reply from G Suite (Internal and External)


Office 365 – Exchange Online Organizational Sharing

Recently I worked with a partner that was doing a larger tenant to tenant migration. Fortunately they were moving from one domain to another and are doing a staged migration with MigrationWiz; because they will have users in one of two tenants, they will need to share free/busy information between the two tenants. This is easily done by setting up Exchange Organizational Sharing between the two Office 365 tenants.

https://technet.microsoft.com/en-us/library/jj916671(v=exchg.150).aspx

Open Office 365 admin center

Click Admin Centers

Click Exchange

Click Organization

Click Sharing

Click New on Organization Sharing

In the Relationship name, enter a friendly name for the relationship

In the Domains to share with box, enter the external Office 365 or Exchange on-premise domain

Click to Enable calendar free/busy information sharing

Set the sharing level for calendar free/busy information

Set which users can share calendar free/busy information.

Click save

Viewing Mailbox Statistics with Get-MailboxStatistics – Office 365 Exchange Online PowerShell

Exchange Online has a number of PowerShell commands that will give you detailed level access into a single or group of mailboxes. One of the more powerful commands is Get-MailboxStatistics.

To get more information on the command, please use this Microsoft site.

https://technet.microsoft.com/en-us/library/bb124612(v=exchg.160).aspx

Connect to Exchange Online with PowerShell

To view Mailbox Statistics for a single mailbox

  1. Get-MailboxStatistics -Identity <UserIdentity>

To view a formatted list of all the parameters on a single mailbox

  1. Get-MailboxStatistics -Identity <UserIdentity> | Format-List

To view Mailbox Statistics for all mailboxes

  1. Get-Mailbox | Get-MailboxStatistics

Disable Access to Exchange Online PowerShell

By default Exchange Online has PowerShell access enabled for all users. The level of access, for the users, is determined by the roles you are assigned in the organization but most security conscious organizations will want to button up and close down access to all users that don’t require it to be enabled.

I will detail a simple method to check access for one account and disable access to that account. For more detailed methods to disable for many accounts, please use this Microsoft KB.

https://technet.microsoft.com/en-us/library/jj984292(v=exchg.160).aspx

Connect to Exchange Online with PowerShell

View the status of a single user

  1. Get-User <UserIdentity> | Format-Table Name,DisplayName,RemotePowerShellEnabled

View the status of all users

  1. Get-User -ResultSize unlimited | Format-Table Name,DisplayName,RemotePowerShellEnabled

Disable access to a single user

  1. Set-User <UserIdentity> -RemotePowerShellEnabled $false

Configure Email Forwarding for an Office 365 (Exchange Online) Mailbox – PowerShell

Configuring email forwarding for an Office 365 (Exchange Online) mailbox can be done in three ways. The user can enable email forwarding on their own using the OWA and editing their settings. This post is going to show how to enable email forwarding on a mailbox from PowerShell. If you are looking at how to complete this with the Exchange Admin Center, please see this post Configure Email Forwarding for an Office 365 (Exchange Online) Mailbox – Exchange Admin Center.

  1. Open a connection to Exchange Online with PowerShell

Make sure to replace “user@domain.com” with the user whose email you want to forward.

Make sure to replace “forward_recipient@domain.com” with the SMTP address to where you want to forward the email to.

  1. If you want to forward email and keep a copy in the local mailbox, execute this command

    Set-Mailbox -Identity “user@domain.com” -DeliverToMailboxAndForward $true
    -ForwardingSMTPAddress “forward_recipient@domain.com”

  2. If you want to forward email and don’t keep a copy in the local mailbox, execute this command

    Set-Mailbox -Identity “user@domain.com” -ForwardingSMTPAddress “forward_recipient@domain.com”

To verify this worked, run the following PowerShell command. This will display the user, the primary SMTP address and the forwarding SMTP address.

Get-Mailbox -Identity “user@domain.com” Format-List DisplayName,PrimarySMTPAddress,ForwardingSMTPAddress

Configure Email Forwarding for an Office 365 (Exchange Online) Mailbox – Exchange Admin Center

Configuring email forwarding for an Office 365 (Exchange Online) mailbox can be done in three ways. The user can enable email forwarding on their own using the OWA and editing their settings. This post is going to show how to enable email forwarding on a mailbox from the Exchange Admin Center. If you are looking at how to complete this with PowerShell, please see this post Configure Email Forwarding for an Office 365 (Exchange Online) Mailbox – PowerShell.

  1. Open Office 365 Admin Center
  2. Navigate to the Exchange Admin Center
  3. Click Recipients
  4. Click Mailboxes
  5. Select the user
  6. Double click the user or click the edit pencil

  7. Click Mailbox Features
  8. Scroll down to Mail Flow and Click View Details

  9. Click to Enable Forwarding
  10. Click Browse and select a user to forward the mail to.
    1. Internal – Select a user from the GAL
    2. External – Select a user from the GAL that is a mail contact or mail user. If the contact or mail enabled user is not there, please use this post to create one.
  11. Choose if you want to keep a copy of the message in the mailbox. By default, the forward won’t keep a copy in the mailbox, it will just forward to the forwarding address
  12. Click OK