How to Use New-Mailbox in Powershell
Creating mailboxes is a core administrative task in Microsoft Exchange. Whether you're setting up a new user, provisioning shared mailboxes for teams like Accounts Payable, or preparing resources for meetings, PowerShell gives you granular control over mailbox creation and configuration through the New-Mailbox cmdlet.
This cmdlet is part of the Exchange Management Shell and also available in Exchange Online PowerShell. It's commonly used by IT administrators managing environments in Exchange Server or Microsoft 365.
What is the New-Mailbox Cmdlet?
New-Mailbox is a PowerShell cmdlet used in Exchange to create new mailbox-enabled recipients. These recipients can include user mailboxes, shared mailboxes, room/resource mailboxes, Linked Mailboxes, and more.
The cmdlet can create both the Active Directory user object and the Exchange mailbox, or just the mailbox for an existing user, depending on the parameters used.
This cmdlet supports:
- Creating a user mailbox in a specific OrganizationalUnit
- Setting up an auto-generated password and user account flags like ResetPasswordOnNextLogon
- Assigning mailbox-specific settings such as PrimarySmtpAddress, UserPrincipalName, and MailboxPlan
Administrators use it as part of onboarding processes, migration projects, and automation scripts involving CSV files or bulk provisioning tasks.
Syntax
The New-Mailbox cmdlet supports multiple parameter sets, and available parameters depend on the mailbox type (User, Shared, Room, etc.) and whether you're in Exchange Online or on-premises Exchange.
User Mailbox (Exchange Online and on-premises)
New-Mailbox -Name "Name" -UserPrincipalName user@meetingroom365.com -Password (ConvertTo-SecureString 'StrongP@ssword' -AsPlainText -Force) [-OrganizationalUnit] [-ResetPasswordOnNextLogon] [-Archive]
Shared Mailbox (Exchange Online)
New-Mailbox -Name "Support" -Shared -DisplayName "Support Mailbox" -UserPrincipalName support@meetingroom365.com
Room Mailbox with login disabled (Exchange Online)
New-Mailbox -Name "Conf Room 1" -Room -UserPrincipalName room1@meetingroom365.com -EnableRoomMailboxAccount $false
Heads up: For room mailboxes, the default behavior creates a user account with a random password. To prevent login, explicitly set -EnableRoomMailboxAccount $false.
Parameters
- Name - Required. The display name of the mailbox and user.
- UserPrincipalName - Email login address (e.g., james@meetingroom365.com).
- Password - Secure password for the new account.
- OrganizationalUnit - Active Directory container to place the user object.
- FirstName, LastName, DisplayName - Optional naming metadata.
- ResetPasswordOnNextLogon - Forces the user to reset their password on first login.
- Shared - SwitchParameter to create a shared mailbox.
- Room / Equipment - Switches for resource mailbox creation.
- Archive - Creates a local archive mailbox.
- MicrosoftOnlineServicesID - Used for Exchange Online identity.
- PrimarySmtpAddress - Defines the default email address.
- LinkedMasterAccount - For Linked Mailbox scenarios (used in resource forests).
- Alias - Mail alias (e.g., marketing@meetingroom365.com).
- SamAccountName - Username for legacy systems.
- DomainController - Specifies which DC to contact (on-prem only).
- AccountDisabled - Creates the mailbox with a disabled account.
- RetentionPolicy, RoleAssignmentPolicy, ThrottlingPolicy - Assigns Exchange policies.
- MailboxPlan - Used in cloud environments to apply service plans.
- EmailAddressPolicyEnabled - Enables or disables automatic email address policies.
- ImmutableId - Used in hybrid environments for sync.
Most of these parameters support wildcard characters and allow pipeline input, giving administrators powerful scripting capabilities.
Other Important Parameters:
- EnableRoomMailboxAccount – (Exchange Online only) Prevents sign-in by disabling the room’s user account
- RoomMailboxPassword – (Exchange Online only) Sets a password if you want a sign-in-enabled room mailbox
- MicrosoftOnlineServicesID – (Exchange Online only) Alternate to UPN, used for some provisioning flows
- MailboxRegion – (Exchange Online only) Required for tenants using Microsoft 365 Multi-Geo
- Discovery – (On-prem only) Creates a Discovery Mailbox used for eDiscovery search results
- AuditLog – (On-prem only) Creates a mailbox used for storing audit logs
- Arbitration – (On-prem only) Used for moderation and approval workflows
- Equipment – (Both environments) Used for equipment/resource mailboxes like projectors
- PublicFolder – (On-prem only) For creating Public Folder Mailboxes
- MailboxPlan – (Exchange Online only) Assigns a specific mailbox service plan
Practical Uses
The New-Mailbox cmdlet is a core part of daily Exchange administration, especially in Microsoft 365 and hybrid environments. Below are three real-world scenarios where this cmdlet applies directly.
1. Onboarding New Employees with Mailboxes
When a new hire joins the company, IT administrators often automate account provisioning. Using New-Mailbox, they can:
- Create the Active Directory user
- Assign a strong password
- Set the PrimarySmtpAddress and UserPrincipalName
- Enable flags like ResetPasswordOnNextLogon
This ensures the new user has immediate access to Outlook, calendar events, and internal DistributionGroups.
2. Creating Shared Mailboxes for Departments
Departments like Accounts Payable, Support, or Marketing typically use shared mailboxes like marketing@meetingroom365.com or helpdesk@meetingroom365.com. These allow multiple team members to send and receive emails from a common address.
Using New-Mailbox -Shared, administrators can:
- Avoid using full licensed users for department communication
- Grant Full Access and Send As permissions via Add-MailboxPermission
- Improve transparency and reduce missed emails
Shared mailboxes are widely used in both cloud-based and on-premises Exchange setups.
3. Provisioning Resource Mailboxes for Rooms and Equipment
In large organizations, managing meeting room availability is key. Admins use New-Mailbox -Room or New-Mailbox -Equipment to create resource mailboxes. These are then integrated with Outlook calendars so users can book them directly.
This is especially relevant in:
- Office relocation or expansion projects
- Enterprises using room panels or calendar integrations
- Organizations standardizing on Exchange Online
Once created, these resource mailboxes can be configured with booking policies, capacity rules, and delegated access.
Prerequisites
Before running the New-Mailbox cmdlet, you need to meet these core requirements:
- Permissions:
You must have the Recipient Management or Organization Management role. - Environment access:
- For Exchange Server, use the Exchange Management Shell.
- For Exchange Online, connect with Connect-ExchangeOnline using the PowerShell module.
- Active Directory (on-premises only):
A writable domain controller and extended AD schema for Exchange are required. - Licensing (Microsoft 365 only):
- User mailboxes require a Microsoft 365 license.
- Shared and resource mailboxes don’t need a license unless users sign in directly.
- Password:
If using -Password, it must meet standard complexity requirements.
How to Use New-Mailbox
Below are step-by-step examples showing how to use the New-Mailbox cmdlet in typical real-world tasks. Each example focuses on a specific scenario: user mailbox, shared mailbox, and room/resource mailbox.
1. Create a New User Mailbox (Exchange Online or On-Premises)
This creates both a new Active Directory user and a mailbox for that user. You’ll need to specify a secure password and set required identity properties.
Command:
New-Mailbox -Name "James Futhey" -UserPrincipalName james@meetingroom365.com -Password (ConvertTo-SecureString -String 'P@ssword1234' -AsPlainText -Force) -FirstName "James" -LastName "Futhey" -DisplayName "James Futhey" -ResetPasswordOnNextLogon $true
What this does:
- Creates a new user account and mailbox for James Futhey
- Assigns an initial password that must be changed at first login
- Sets UserPrincipalName, display name, and name metadata
Use this for onboarding in Microsoft 365 or Exchange Server when no AD user object exists yet.
2. Create a Shared Mailbox
Shared mailboxes do not require a license unless a user signs in directly. However, a user account is still created and appears in Azure AD and Microsoft 365 Admin Center. The account is typically disabled by default.
Command:
New-Mailbox -Name "Support Mailbox" -DisplayName "Support" -Shared -UserPrincipalName support@meetingroom365.com
What this does:
- Creates a shared mailbox named Support
- Makes the mailbox accessible to multiple users with delegated permissions
- No password or login is set by default
Next, use Add-MailboxPermission and Add-RecipientPermission to give users Full Access and Send As rights.
3. Create a Room Mailbox for Conference Room Scheduling
Room mailboxes are used for meeting room scheduling. By default in Exchange Online, the mailbox is created with an associated disabled user account that has a random, unknown password.
Command:
New-Mailbox -Name "Conf Room 1F" -Room -UserPrincipalName confroom1f@meetingroom365.com -EnableRoomMailboxAccount $false
To explicitly prevent login access, add -EnableRoomMailboxAccount $false.
If you want to allow sign-in (rare), you must use -EnableRoomMailboxAccount $true and set a password using -RoomMailboxPassword.
4. Create a Mailbox Using a Mailbox Plan (Exchange Online Only)
Mailbox plans define quota, features, and service settings in cloud environments.
Command:
New-Mailbox -Name "James" -UserPrincipalName james@meetingroom365.com -Password (ConvertTo-SecureString 'P@ssword1234' -AsPlainText -Force) -MailboxPlan "Contoso-Standard"
What this does:
- Creates a cloud mailbox using a specific MailboxPlan
- Applies preconfigured settings for storage, policies, and services
- Used by service providers and Microsoft 365 admins managing tenants
Plans must already be defined and available in the tenant.
5. Create a Mailbox with Archive Enabled
Useful for organizations that want to offload older emails automatically.
Command:
New-Mailbox -Name "John Wick" -UserPrincipalName john@meetingroom365.com -Password (ConvertTo-SecureString 'Str0ngPass!' -AsPlainText -Force) -Archive
What this does:
- Creates a primary mailbox for John
- Automatically provisions a local archive mailbox
- Archive policies can later be configured via Set-Mailbox
This helps with email management, storage limits, and compliance.
Other Mailbox Types You Can Create
Besides User, Shared, and Room mailboxes, the New-Mailbox cmdlet can also be used to create:
- Equipment Mailbox – Bookable resources like projectors or vehicles
- Discovery Mailbox – Used for storing eDiscovery search results
- AuditLog Mailbox – Stores audit data for compliance scenarios
- Arbitration Mailbox – Supports moderation and workflow approvals
- Public Folder Mailbox – For storing public folders in Exchange Server
- Linked Mailbox – Used in cross-forest deployments (on-premises only)
To use these, apply the appropriate switch parameter (e.g., -Equipment, -Discovery, etc.) based on your environment.
The New-Mailbox cmdlet is essential for provisioning mailboxes in Exchange Server and Exchange Online, but usage depends heavily on the mailbox type and environment.
Always review the required parameters and understand the security model - especially for shared and room mailboxes that create underlying user accounts. For full support of advanced use cases, refer to Microsoft’s official documentation.