enable mailbox exchange online powershell

Enable Mailbox in Exchange Online with PowerShell

By Christopher Lewis
AD

Are you looking to manage your Mailbox in Exchange Online using PowerShell? You're in the right place. In this guide, we'll walk you through the process of enabling and using Exchange Online PowerShell, making your mailbox management tasks a breeze.

Understanding Exchange Online PowerShell

Exchange Online PowerShell is a remote shell that allows you to connect to Exchange Online and perform tasks that would otherwise be complex or time-consuming. It's a powerful tool that enables you to manage your mailboxes, public folders, and more, all from the comfort of your PowerShell environment.

Prerequisites

Before we dive into the process, ensure you have the following:

AD
9 Best Virtual Mailbox Providers to Use This Year
9 Best Virtual Mailbox Providers to Use This Year
Create shared mailbox on Hybrid environment - directly on O365 or onpremises then migrate it to O365 | Microsoft Community Hub
Create shared mailbox on Hybrid environment - directly on O365 or onpremises then migrate it to O365 | Microsoft Community Hub
How to Organize Your Email with Smart Mailboxes in Apple Mail
How to Organize Your Email with Smart Mailboxes in Apple Mail
  • Exchange Online account with appropriate permissions
  • PowerShell 5.0 or later installed on your computer
  • Exchange Online PowerShell V2 module (recommended)

Enabling Exchange Online PowerShell

Now, let's enable Exchange Online PowerShell on your system. We'll use the Exchange Online PowerShell V2 module for this guide.

Installing the Exchange Online PowerShell V2 Module

First, you need to install the Exchange Online PowerShell V2 module. You can do this using the following command in your PowerShell:

The 2019 Guide to Achieving Inbox Zero Outlook | Step-by-step Guide
The 2019 Guide to Achieving Inbox Zero Outlook | Step-by-step Guide
an email address is shown in the form of a mailbox
an email address is shown in the form of a mailbox
Resource Center: Budget Mailboxes
Resource Center: Budget Mailboxes

Install-Module -Name ExchangeOnlineManagement

Connecting to Exchange Online PowerShell

Once the module is installed, you can connect to Exchange Online PowerShell using the Connect-ExchangeOnline cmdlet. Here's how:

AD

Connect-ExchangeOnline -UserPrincipalName user@domain.com

Virtual Mailbox Basics: How I Get Mail While I Travel Full-Time...
Virtual Mailbox Basics: How I Get Mail While I Travel Full-Time...
How to Save Commonly Used Searches in Outlook
How to Save Commonly Used Searches in Outlook
the mailbox rental flyer is red and white
the mailbox rental flyer is red and white
What is USPS Form 1583 and Why Do You Need It For Your Virtual Mailbox?
What is USPS Form 1583 and Why Do You Need It For Your Virtual Mailbox?
an iphone with mailboxes on the screen and other email notifications coming out
an iphone with mailboxes on the screen and other email notifications coming out
How to Set an Out of Office Reply in Outlook 2016 and Prior
How to Set an Out of Office Reply in Outlook 2016 and Prior

Replace user@domain.com with your Exchange Online user principal name.

Verifying the Connection

After a successful connection, you'll be prompted to enter your password. Once you've done that, you can verify the connection by checking your Exchange Online version:

AD

Get-ExchangeServer | Select-Object -ExpandProperty Edition

24 Mailbox Ideas to Spruce Up Your Curb Appeal
24 Mailbox Ideas to Spruce Up Your Curb Appeal
a mailbox sitting on the side of a road
a mailbox sitting on the side of a road
How to Forward Mail With The Post Office
How to Forward Mail With The Post Office
17+ Creative Package Mailbox Ideas
17+ Creative Package Mailbox Ideas
How to Import Contacts to Outlook from a CSV
How to Import Contacts to Outlook from a CSV
Tips to Unlocking the Full-Time RV Dream | Life in The RV
Tips to Unlocking the Full-Time RV Dream | Life in The RV
a pile of pink paper sitting on top of a table
a pile of pink paper sitting on top of a table
A step-by-step process to restore Gmail Email
A step-by-step process to restore Gmail Email
a mailbox with some papers in it
a mailbox with some papers in it
15 Creative Double Mailbox Post Ideas for Your Front Yard
15 Creative Double Mailbox Post Ideas for Your Front Yard
Enable or disable Forgotten Attachment Reminder in Outlook
Enable or disable Forgotten Attachment Reminder in Outlook
Beautify Your Entryway: Unique Mailbox Designs
Beautify Your Entryway: Unique Mailbox Designs
three mailboxes in front of a large house
three mailboxes in front of a large house
Outlook Is Microsoft's Answer To Everything You've Ever Hated About Hotmail
Outlook Is Microsoft's Answer To Everything You've Ever Hated About Hotmail

Managing Mailboxes with Exchange Online PowerShell

Now that you're connected, you can start managing your mailboxes. Here are a few examples:

Getting a List of Mailboxes

To get a list of all mailboxes in your organization, use the Get-Mailbox cmdlet:

AD

Get-Mailbox -ResultSize Unlimited

Creating a New Mailbox

To create a new mailbox, use the New-Mailbox cmdlet:

New-Mailbox -Name "John Doe" -UserPrincipalName john.doe@domain.com -Alias jdoe

Removing a Mailbox

To remove a mailbox, use the Remove-Mailbox cmdlet:

Remove-Mailbox -Identity "John Doe" -Confirm:$false

Disconnecting from Exchange Online PowerShell

When you're done, you can disconnect from Exchange Online PowerShell using the Disconnect-ExchangeOnline cmdlet:

Disconnect-ExchangeOnline

And that's it! You've successfully enabled and used Exchange Online PowerShell to manage your mailboxes. Happy managing!

AD