Problem creating exchange mailbox through an ASP.NET application

S

Suman

Hello Group,

I am relatively new to .NET. I am trying to create a user in AD and a
corresponding email account in the exchange server from an ASP.NET, C#
application.

-----------------------------
I have a problem wherein I am able to create a user but am
unable to create a mailbox for the user. I "WAS" using exchange 2000.

The error that I was getting is a class cast exception when I try to do

this:

DirectoryEntry user1 = new DirectoryEntry(path, username, password);
IMailboxStore mailbox;
//exception caused in the next line
mailbox = (IMailboxStore)(user1.NativeObject);

Exception Details: System.InvalidCastException: Specified cast is not
valid.

I have read that CDOEXM does not work in asp.net. Most of the
discussions suggest using a COM object. I do not know how to deal with
COM objects or how they work. I dont know if the above error is well
before the execution needs the CDOEXM specific alteration or if its
just someother error.
-----------------------------

Anyways, now I am at a stage where, I have a seperate domain setup just

to test this application and that runs WIN 2003 and Exchange 2003 SP 2.



I want to not be able to do the same here on the new domain.
1) Create a user in AD and
2) Create a corresponding Mailbox through a asp.net, C# application.


I am able to do the first task. Could any of you provide some code for
creating an email account through an asp.net application and show how
the COM object would be implemented in C# and used from the asp.net
application.


OR
I still have access to the previous environment. If something strikes
you looking at the exception that I was getting in the previous domain
and that can be fixed to create email accounts in the Exchange 2000,
that should be fine too.


I would be really thankful to you for any help provided. I have been
trying to complete this project for a really long time now.


Thanks a lot in advance.
Suman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top