set mailbox powershell example

Set Mailbox in PowerShell: A Step-by-Step Example

By Anthony Jones
AD

Managing mailboxes in a Windows environment can be a breeze with PowerShell. The Set-Mailbox cmdlet is a powerful tool that allows you to configure various aspects of mailboxes. Let's explore how to use this cmdlet with some practical examples.

Before we dive into the examples, ensure you have the Exchange Online PowerShell V2 module installed. If not, you can install it using the command: Install-Module -Name ExchangeOnlineManagement

Setting Mailbox Properties

The Set-Mailbox cmdlet enables you to modify numerous properties of a mailbox. Here are a couple of examples:

AD
22 Sturdy Mailbox Post Ideas for Better Security and Curb Appeal - Lost At E Minor
22 Sturdy Mailbox Post Ideas for Better Security and Curb Appeal - Lost At E Minor
17+ Mailbox Landscaping Ideas That Boost Curb Appeal
17+ Mailbox Landscaping Ideas That Boost Curb Appeal
Mail Boss Mail Manager PRO Security Locking Mailbox
Mail Boss Mail Manager PRO Security Locking Mailbox

Setting an Email Address

You can use the Set-Mailbox cmdlet to set or modify the email address of a mailbox. Here's an example:

Set-Mailbox -Identity "John Doe" -EmailAddresses "johndoe@domain.com"

Modern & Custom Mailboxes | Dream Mailboxes
Modern & Custom Mailboxes | Dream Mailboxes
a mailbox sitting in the grass next to a street with palm trees behind it
a mailbox sitting in the grass next to a street with palm trees behind it
Microsoft Exchange Server 2013 : Creating new mailboxes (part 3) - Default folders, Manipulating mailbox settings
Microsoft Exchange Server 2013 : Creating new mailboxes (part 3) - Default folders, Manipulating mailbox settings

Enabling or Disabling Mailbox Features

You can enable or disable various features of a mailbox, such as Litigation Hold, In-Place Hold, or Retention Hold. Here's how you can enable Litigation Hold for a mailbox:

Set-Mailbox -Identity "John Doe" -LitigationHoldName "Litigation Hold"

AD

Managing Mailbox Permissions

The Set-Mailbox cmdlet also allows you to manage mailbox permissions. Here are two subtopics demonstrating this:

Mailbox
Mailbox
Having difficulty choosing the right mailbox?
Having difficulty choosing the right mailbox?
Locking Mailboxes Plano | Security Mailbox Plano, TX
Locking Mailboxes Plano | Security Mailbox Plano, TX
Solace - All Bronze / Silver / White Oasis
Solace - All Bronze / Silver / White Oasis
๐‘€๐’ถ๐’พ๐“ ๐’ท๐‘œ๐“ ๐Ÿ“ฎ
๐‘€๐’ถ๐’พ๐“ ๐’ท๐‘œ๐“ ๐Ÿ“ฎ
Las mรกquinas fitness ideales para potenciar tus resultados en el gimnasio
Las mรกquinas fitness ideales para potenciar tus resultados en el gimnasio

Granting Full Access Permissions

You can grant full access permissions to another user, allowing them to open and use the mailbox as if it were their own. Here's an example:

Set-Mailbox -Identity "John Doe" -AddGrantee "Jane Doe" -AccessRights FullAccess

AD

Removing Access Permissions

Similarly, you can remove access permissions from a mailbox. Here's how you can remove full access permissions granted to "Jane Doe":

a man standing next to a wooden box with a phone hooked up to it's side
a man standing next to a wooden box with a phone hooked up to it's side
a white mailbox sitting in the middle of some bushes
a white mailbox sitting in the middle of some bushes
How To Convert MBOX To PST Mailbox Using Stellar Converter Tool
How To Convert MBOX To PST Mailbox Using Stellar Converter Tool
Modern Composite Mailbox Post with Solar Light and House Numbers
Modern Composite Mailbox Post with Solar Light and House Numbers
a mailbox made out of wooden pallets with the number 4 lit up on it
a mailbox made out of wooden pallets with the number 4 lit up on it
macOS Mail: Making a "Not Replied To" Smart Mailbox
macOS Mail: Making a "Not Replied To" Smart Mailbox
How to Install a Mailbox: Please, Mr. Postman, Is Mine Up to Code?
How to Install a Mailbox: Please, Mr. Postman, Is Mine Up to Code?
High Security Locking Column Mailbox Insert
High Security Locking Column Mailbox Insert
USPS Mailbox Key Replacement: Cost, Form, and Step-by-Step Guide
USPS Mailbox Key Replacement: Cost, Form, and Step-by-Step Guide
two black and white mailboxes in front of a house
two black and white mailboxes in front of a house
a mailbox that is made out of wood and has the number 4797 on it
a mailbox that is made out of wood and has the number 4797 on it
a stack of wooden blocks sitting on top of a dirt field
a stack of wooden blocks sitting on top of a dirt field
a white and black box with numbers on it in front of some rocks, plants and trees
a white and black box with numbers on it in front of some rocks, plants and trees
Mailbox Slide Out Tray with Matte Black Baked Enamel Finish
Mailbox Slide Out Tray with Matte Black Baked Enamel Finish

Set-Mailbox -Identity "John Doe" -RemoveGrantee "Jane Doe" -AccessRights FullAccess

In your PowerShell journey, you'll find many more use cases for the Set-Mailbox cmdlet. Keep exploring and expanding your skills. Happy scripting!

AD
AD