We help IT Professionals succeed at work.

Exchange Server from D3

dvaline asked
Medium Priority
Last Modified: 2010-04-04
Points for example code for creating and deleting Mailboxes on the exchange server.  I am using exchange server v4 sp5.

What I'd like are two functions...

CreateMailbox(UserName, FirstName, LastName, Server, Domain: String);


DeleteMailbox(UserName, Server, Domain: String);
Watch Question

Hi dvaline,

I think it's only possible with the extended MAPI functions, but I never used these... I'll try to look it up but now you have a deriction to look at, yourself.

Regards, Zif.


Your answer is good, all I need is an example of how to Create a Mailbox and the points are yours, notice, I included a bonus...
I don't have the slightest idea how to do this but you can EMail the author and ask him for example:

I believe this is the article :

In the exchange administrator, you can export mailboxes, distribution lists
                            etc into .csv files, make changes, and then import it back into exchange,
                            which will create / delete modify these things. The easiest way to see what
                            it is doing, is export your mailboxes to the text file, and have a look. For
                            example the following text (save it to a text file) will create a mailbox,
                            with an associated NT account. Use the Tools\Directory Import command in the
                            exchange administrator. Change the "Primary Windows NT Account", and the
                            "Home-Server" items to your configuration. BTW, these are not all of the
                            available fields, just the ones we need to create this mailbox.

                            "Obj-Class","Mode","First Name","Last name","Display Name","Alias
                            Name","Directory Name","Primary Windows NT

                            If you want to do it programatically, look in the SDK for BatchImport and
                            BatchExport, which are the functions that the admin utilty uses. The format
                            of the file you pass to BatchImport is the same as above.

                            The main options under "Mode" are Create, Delete, and Modify, which are
                            fairly self explanatory. From memory, if you pass modify and the mailbox
                            doesn't exist, it will be created.



I've been aware of the functions, i have had little success in making them work.

If you have any plans of migrating your exchange servers to v5.5 in the near future, you should take a look at ADSI (http://backoffice.microsoft.com/downtrial/moreinfo/adsi2.asp). This is a Directory Service interface, which will allow you to add Exchange 5.5 stuff (users/distributionlists etc.), NT 4/5 stuff (users / shares..), IIS stuff, ?? stuff. You can talk to everything that talks LDAP.

I've just found this:

Exchange 4.0-5.5 DELPHI 3 interface - NEW VERSION
This unit is FREE for ANY comment`s, notes and etc.., but please for feedback.

Also included small DAPI DCOM SERVER, who create MAILBOX on Exchange Server, and sample Client application for DAPI DCOM SERVER.

Source:      http://www.ccgc.net/dwn/dapi.htm

are you still interested in a working answer ? If no, you could delete this question to move it out of the awaiting answers area. If yes, just post a comment.


Unlock this solution and get a sample of our free trial.
(No credit card required)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.