Exchange 2007: Create a new mailbox from the command line
Takeaway: Scott Lowe provides a step-by-step account of how to create a new mailbox in Exchange 2007.
With its PowerShell-based command line, Exchange 2007 opens up huge possibilities when it comes to automating account and mailbox creation. In Exchange 2007, the mailbox creation process has been de-linked from account creation. In other words, when you create an Active Directory account, Active Directory Users and Computers (ADUC) no longer prompts you asking if you want to create an Exchange mailbox to go along with the new user.
Whether or not this was a mistake on Microsoft's part is moot at this point. In any case, account and mailbox creation becomes a two-step process. So, the steps you see here assume that you have already created a user account in Active Directory--either manually or via a script.
I should point out here that, while Exchange management has been removed from ADUC, you can create a new AD account from within the Exchange Management Console (EMC) by going through the mailbox creation wizard. I will not be covering the creation of an AD account from that tool in this tip, however, as the EMC is not as full-featured as ADUC when it comes to managing user account attributes.
When you create a mailbox from the GUI, you need to specify the mailbox type (User, Room, Equipment, or Linked), tell the EMC which Exchange server you want to host the new mailbox, and choose a storage group and mailbox database from that server. You need to specify similar information if you opt to use the command line.
As a test, I created a couple of user accounts in AD. The first one, Jack Doe, is a fake account that I'll use to determine the parameter values that I need for scripting. The new GUI shows you the output from all of the commands you perform to make it easier to script. You'll see how important this is in a second.
Figure A shows the output from the Exchange Management Console from my task of creating a mailbox on the server named E2007-3 for the user named Jack Doe.
Figure A |
![]() |
| The output from the Exchange Management Console. |
Note the complexity of some of the objects you need to address in your mailbox creation script.
Now, you probably have not memorized the GUID for every object in your Exchange organization, but you need to use it in some commands, as you can see in Figure A. Using this output as a template, I'll create a mailbox for the user named John Doe.
Enable-Mailbox -Identity 'contoso.com/Users/John Doe'
-Alias 'john.doe' -Database 'CN=Mailbox Database,
CN=First Storage Group,CN=InformationStore,
CN=E2007-3,CN=Servers,CN=Exchange Administrative Group
(FYDIBOHF23SPDLT),CN=Administrative Groups,
CN=335A1087-5131-4D45-BE3E-3C6C7F76F5EC,CN=Microsoft
Exchange,CN=Services,CN=Configuration,
DC=contoso,DC=com'
When complete, the shell responds back with a little information about the new mailbox, as you can see in Figure B.
Figure B |
![]() |
| Here is some information about the new mailbox. |
The mailbox was created successfully.
Print/View all Posts Comments on this article
|
|
|
|
|
|
White Papers, Webcasts, and Downloads
- Why Isn't Server Virtualization Saving Us More? A Few Small Changes May Dramatically Increase Your Efficiency VMware Ever wonder why your company isn't saving more from its server virtualization? Making a few small changes could dramatically increase your efficiency. Download Now
- Building the Virtualized Enterprise with VMware Infrastructure VMware This paper explains how adopting a virtual infrastructure -- comprised of server, storage, and networking virtualization technologies -- can help your organization build a sustainable competitive ... Download Now
- VMware Infrastructure: A Guide to Bottom-Line Benefits VMware Frustrated by the high cost of maintaining or building ever-larger data centers? Get the facts you need to formulate your Virtualization Action Plan. Download Now
- The Impact of Virtualization Software on Operating Environments VMware Today's use of virtualization technology allows IT professionals to ... Download Now
- Five Steps to Determine When to Virtualize YourServers VMware Thinking of virtualizing the servers at your company? Use this step-by-step guide to determine when's the best time to make your big move. Download Now
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET



