Exchange.2k.Mailbox.Create
Top  Previous  Next


Creates Exchange 2000 or 2003 mailbox and adds reference to the mailbox in the AD of the DC. Use Exchange.2k.Mailbox.SetProperty after the create mailbox command to specify e-mail addresses etc. Notice that the Exchange recipient update service will create SMTP and X400 email addresses from the alias and the full name if no email addresses are specified.

Before using Exchange.2k.Mailbox.Create, use AD.Account.Create to create Windows 2000 Accounts for the Mailboxes.

Since it is almost impossible to enter all parameters for "Exchange.2k.Mailbox.Create" correctly you should use the script wizard to get started:

1) Create a template account in Active directory users and computers.

Start "Administrative tools" > "Active directory users and computers". Right click your target container and choose "New" > "Account". Make sure to specify a UPN for the account. Please also make sure that "Create an Exchange mailbox" is checked in the dialog that is displayed after the password dialog.

2) Use the script wizard to extract command parameters from the template account.

Click the SetupBatcher script wizard icon. Choose "Active directory with Exchange 2000 server". Click "Next" and specify the UPN of the template account that you created above. Proceed with the remaining steps of the wizard and when finished you will automatically have a script that contains all parameters for "AD.Account.Create" and "Exchange.2k.Mailbox.Create".

Category

Exchange 2000

Script section
[Batch], inside Data.Loop..EndLoop statement

Requirements
·Exchange 2000 server  
·Exchange 2000 system manager  

Exchange.2k.Mailbox.Create ExchServer, ExchOrg, ExchAdminGroup, ExchStorageGroup, ExchMailBoxStore, DCserver, Domain, CommonName

ExchServer
Exchange Server Name*  

ExchOrg

Exchange Server Organization  

ExchAdminGroup

Exchange Server Administrative group, usually "First Administrative group"  

ExchStorageGroup

Name of Storage group, usually "First Storage Group"  

ExchMailBoxStore
Name of Mailbox store, usually "Mailbox Store (servername)"  

DCserver
Name of DC*  

Domain
Domain  

CommonName
Full AD path to mailbox owner  

*) If the DC and the E2k server are on the same machine then ExchangeServer = DCServer. (Use "%servername2%" to read out the server name without double backslashes from the [Machines] section.)

Common error messages / causes
An operations error occurred (#0)   
The path part of the "CommonName" parameter is invalid.
There is no such object on the server (#0)   
The account specified in the "CommonName" parameter does not exist.
Method 'CreateMailBox' not supported by automation object (#10)
Install Exchange 2000 system manager
The server is not operational (#10)
Probably means that the "DCserver" parameter is incorrect.
There is no such object on the server. (#10)
Probably means that one or more of the parameters "ExchServer", "ExchOrg", "ExchAdminGroup", "ExchStorageGroup" or "ExchMailBoxStore" are incorrect.


Examples

Server layout

Notice: Administrative groups is not visible by default. To see them in the Exchange System Manager; right click the organization and choose properties, then check the "Display administrative groups" box.

·Exchange server = DCserver = "\\main03"  
·Organization name = "MyOrg", ignore the ending "(Exchange)"  
·Administrative group = "First Administrative group"  
·Storage group = "First Storage Group"  
·Mailbox store = "Mailbox Store (main03)"  
·Domain ="d29.acme.com" -> "dc=com/dc=acme/dc=d29"  

1) Create mailbox for account "steve", container=users

Exchange.2k.Mailbox.Create Main03, MyOrg, First Administrative group, First Storage Group, Mailbox Store (main03), Main03, dc=com/dc=acme/dc=d29, dc=com/dc=acme/dc=D29/cn=users/cn=steve

2) Create mailbox for account with common name from [data] column 2, organizational unit=MyOU

Exchange.2k.Mailbox.Create Main03, MyOrg, First Administrative group, First Storage Group, Mailbox Store (main03), Main03, dc=com/dc=acme/dc=d29, dc=com/dc=acme/dc=D29/ou=MyOU/cn=%col2%