CDOEXM.IMailboxStore.CreateMailbox Error

G

Guest

Hi,

I am trying to create a exchange mailbox-enabled user on Exchange Server
2003 via w ASP.NET web applcation (written in C#). I can create the user
successfully but when I try to create the mailbox I get the following
exception:

System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic
failure at CDOEXM.IMailboxStore.CreateMailbox(String HomeMDBURL)

I used to be able to do this fine with Exchange 2000.

My code is:

string mailboxStore =
ConfigurationSettings.AppSettings["email.exchange.mailboxstore"];
string storageGroup =
ConfigurationSettings.AppSettings["email.exchange.storagegroup"];
string server = ConfigurationSettings.AppSettings["email.exchange.server"];
string organisation =
ConfigurationSettings.AppSettings["email.exchange.organisation"];
string dom = ConfigurationSettings.AppSettings["email.exchange.domain"];
string domEnding =
ConfigurationSettings.AppSettings["email.exchange.domainending"];
string adminGroup =
ConfigurationSettings.AppSettings["email.exchange.admingroup"];

string fullName = "TestUser";
string alias = fullName ;
string password = fullName;
string createURL = "CN=" + mailboxStore + ",CN=" + storageGroup +
",CN=InformationStore,CN=" + server + ",CN=Servers,CN=" + adminGroup +
",CN=Administrative Groups,CN=" + organisation + ",CN=Microsoft
Exchange,CN=Services,CN=Configuration,DC=" + dom + ",DC=" + domEnding;


DirectoryEntry container, user;
CDOEXM.IMailboxStore mailbox;

//create new user
container = new DirectoryEntry("LDAP://cn=users,DC=" + dom + ",DC=" +
domEnding);
user = container.Children.Add("cn=" + fullName, "user");
user.Properties["sAMAccountName"].Add(alias);
user.CommitChanges();
user.Invoke("SetPassword", new object[]{password});

//enable new user
user.Properties["userAccountControl"].Value = 0x200;
user.CommitChanges();

//create mailbox
mailbox = (IMailboxStore)user.NativeObject;
mailbox.CreateMailbox(createURL);
user.CommitChanges();

I'm pretty sure my createURL is correct, and I am running this code under an
impersonated account that has Exchange View Administrator priviledges.

If anyone has any ideas on how to solve this, please let me know, I would be
very very grateful... and you'd save me from insanity too!

Cheers,
Mandy
 

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,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top