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