New mailbox cmdlet
You're looking to create a new mailbox using PowerShell!
The cmdlet you're looking for is New-Mailbox
. Here's the syntax:
New-Mailbox -Name <Name> -UserPrincipalName <UPN> -Alias <Alias> -Database <Database> [-OrganizationalUnit <OU>] [-PrimarySmtpAddress <SMTPAddress>] [-RecipientLimits <RecipientLimits>] [-RecipientPolicy <RecipientPolicy>] [-HiddenFromAddressListsEnabled <$true | $false>] [-HiddenFromExchangeClientsEnabled <$true | $false>] [-IgnoreDefaultScope <$true | $false>] [-DomainController <FQDN>] [-WhatIf [<SwitchParameter>]] [-Confirm [<SwitchParameter>]]
Here's a breakdown of the parameters:
-Name
: The name of the new mailbox.-UserPrincipalName
: The UPN of the user account associated with the mailbox.-Alias
: The alias of the mailbox.-Database
: The database where the mailbox will be created.-OrganizationalUnit
: The OU where the mailbox will be created (optional).-PrimarySmtpAddress
: The primary SMTP address of the mailbox (optional).-RecipientLimits
: The recipient limits for the mailbox (optional).-RecipientPolicy
: The recipient policy for the mailbox (optional).-HiddenFromAddressListsEnabled
: Whether the mailbox is hidden from address lists (optional).-HiddenFromExchangeClientsEnabled
: Whether the mailbox is hidden from Exchange clients (optional).-IgnoreDefaultScope
: Whether to ignore the default scope (optional).-DomainController
: The FQDN of the domain controller to use (optional).-WhatIf
and-Confirm
: Switch parameters to simulate the command without creating the mailbox.
Here's an example:
New-Mailbox -Name "John Doe" -UserPrincipalName "[email protected]" -Alias "johndoe" -Database "Mailbox Database" -OrganizationalUnit "Contoso.com/Users"
This command creates a new mailbox named "John Doe" with the UPN "[email protected]", alias "johndoe", and database "Mailbox Database" in the OU "Contoso.com/Users".