Tip: Use a cmdlet to Create a User account and Mailbox in Exchange 2010

Follow Our Daily Tips

RSS | Twitter | Blog | Facebook

Tell Us Your Tips

Share your tips and tweaks.

In the Exchange Management Shell, you can create a user account with a mailbox by using the New-Mailbox cmdlet.

Here’s an example of the syntax and usage.

Note: When you are prompted, enter a secure password for the new user account.

Syntax

 

New-Mailbox -Name Name -Password Password
-UserPrincipalName UserNameAndSuffix 
[-MailboxPlan <MailboxPlanIdParameter>] {AddtlParams} {ModParams}
New-Mailbox -Name Name -Password Password -WindowsLiveID WindowsLiveId
[-EvictLiveId {$true | $false}] [-MailboxPlan MailboxPlanId]
{AddtlParams} {ModParams}
New-Mailbox -Name Name -UserPrincipalName UserNameAndSuffix
[-MailboxPlan MailboxPlanId] {AddtlParams} {ModParams}
New-Mailbox -Name Name -UseExistingLiveId {$true | $false} -WindowsLiveIDWindowsLiveId 
[-MailboxPlan MailboxPlanId] {AddtlParams} {ModParams}
New-Mailbox -Name Name -Shared {$true | $false} -UserPrincipalNameUserNameAndSuffix
 [-Password Password] {AddtlParams} {ModParams}
New-Mailbox -Name Name -Room {$true | $false} -UserPrincipalNameUserNameAndSuffix
 [-Password Password] {AddtlParams} {ModParams}
New-Mailbox -Name Name -Equipment {$true | $false} -UserPrincipalNameUserNameAndSuffix
 [-Password Password] {AddtlParams} {ModParams}
New-Mailbox -Name Name -LinkedDomainController DCName
-LinkedMasterAccount Identity -UserPrincipalName UserNameAndSuffix
[-LinkedCredential Credential] [-Password Password]{AddtlParams} {ModParams}
New-Mailbox -Name Name -ImportLiveId {$true | $false}
 -WindowsLiveIDWindowsLiveId {AddtlParams} {ModParams}
New-Mailbox -Name Name -Arbitration {$true | $false} -UserPrincipalNameUserNameAndSuffix
 [-Password Password] {AddtlParams}
New-Mailbox -Name Name -FederatedIdentity FederatedId -WindowsLiveIDWindowsLiveId {AddtlParams}

{ModParams}
[-ArbitrationMailbox ModeratorMailbox] [-ModeratedBy Moderators][-ModerationEnabled <$true | $false>]
 [-SendModerationNotifications<Never | Internal | Always>]

{AddtlParams} 
[-ActiveSyncMailboxPolicy MailboxPolicyId] [-Alias ExchangeAlias] [-Archive {$true | $false}] 
[-Database DatabaseId] [-DisplayName Name] [-DomainController FullyQualifiedName] [-FirstName FirstName] 
[-Initials Initials] [-LastName LastName] [-ManagedFolderMailboxPolicy MailboxPolicyId] 
[-ManagedFolderMailboxPolicyAllowed {$true | $false}] [-Organization OrgName] [-OrganizationalUnit OUName] 
[-PrimarySmtpAddress SmtpAddress] [-QueryBaseDNRestrictionEnabled <$true | $false>] 
[-RemoteAccountPolicy RemoteAccountPolicyId] [-ResetPasswordOnNextLogon <$true | $false>] 
[-SamAccountName PreWin2000Name] [-SharingPolicy SharingPolicyId] [-ThrottlingPolicy ThrottlingPolicyId]

Usage

New-Mailbox -Name "Shane S. Kim" -Alias "shanek" -OrganizationalUnit "cpandl.com/Engineering" 
-Database "Engineering Primary" -UserPrincipalName "shanek@cpandl.com" -SamAccountName "shanek" -FirstName "Shane" 
-Initials "S" -LastName "Kim" -ResetPasswordOnNextLogon $true -Archive $true

From the Microsoft Press book Microsoft Exchange Server 2010 Administrator’s Pocket Consultant by William R. Stanek.

Looking for More Tips?

For more tips on Exchange Server and other Microsoft technologies, visit the TechNet Magazine Tips library.