How to create a mailbox database in exchange using PowerShell

Create a mailbox database in Exchange Server

Manually provisioning mailbox databases to new users can be arduous. However, administrators can turn to PowerShell scripts to create mailbox database easily. The below script will create a mailbox database in an Exchange Server with the name 'D10'. To create a Database of any desired name replace 'D10' with the required database name.

Script

<#
.SYNOPSIS
This script can be used to create a mailbox Database in Exchange Server.
.DESCRIPTION
This script can be used to create a mailbox Database in Exchange Server.
.EXAMPLE
C:\PS> C:\Script\Database.ps1
To create mailbox database in exchange server with name D10.
#>

$cred = Get-Credential ajax\administrator
#To connect using remote PowerShell, if you don’t have Exchange Management Tools installed.

$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://ajax-ex1/powershell -Credential $cred
Import-PSSession $session
# To create a mailbox database, use the New-MailboxDatabase cmdlet.

New-MailboxDatabase -Name D10 -Server ajax-ex1 | Mount-Database

Post navigation


    • Related Articles

    • How to find unused Exchange Online mailboxes

      What are unused Exchange Online mailboxes and how to identify them? Unused Exchange Online mailboxes are user mailboxes which are currently not being used by their users. There are 3 ways in which we can identify if a mailbox is unused or not. They ...
    • How to monitor Microsoft 365 email and mailbox activity with PowerShell

      Monitoring Microsoft 365 email and mailbox activity with PowerShell can be a crucial part of managing your organization's email security and compliance. With PowerShell, you can quickly and easily automate the process of monitoring email and mailbox ...
    • Managing mailboxes and their quota limits in Exchange

      Management of the Microsoft Exchange environment in an organization is a comprehensive process. One of the various tasks is managing mailboxes, defining their quota limits, and identifying those that are over their given quota limit. This task can be ...
    • Create a shared folder

      Provisioning and managing shared folders through the native Windows process is a pretty straightforward process. However, things can get quickly out of hand when you need to manage multiple shares across multiple computers. With PowerShell, you can ...
    • Create a ShortCut for an Exe File

      Creating a shortcut to an application on multiple end user desktops can be a laborious task. However, the process is pretty straightforward when using a PowerShell script. In the following script, provide the path of the EXE file and the exact path ...