Creating MailBox using CDOEXM in asp.net

Last post 07-23-2008 12:25 AM by MustaqAhmed. 4 replies.

Sort Posts:

  • Creating MailBox using CDOEXM in asp.net

    06-18-2008, 2:30 AM
    • Loading...
    • MustaqAhmed
    • Joined on 06-17-2008, 8:18 AM
    • Posts 3

    I am trying to create a new user in AD and MailBox for this user in Exchange server using CDOEXM  ,

    User is getting created successfully but when I try to create mail box I am getting the error as

    There is no such object on the server. (Exception from HRESULT: 0x80072030) 

    I am using code given under article

    http://support.microsoft.com/kb/313114

    we have AD and Exchange server installed on two different servers, 

    please help me in this regard,

    Thanks in advance, 

     

     

  • Re: Creating MailBox using CDOEXM in asp.net

    06-25-2008, 7:19 AM
    • Loading...
    • johram
    • Joined on 06-13-2006, 10:36 AM
    • Sweden
    • Posts 3,352
    • Moderator

    This typically means that you have an invalid LDAP path somewhere. When does this error occur, at what statement in your code?

    If this post was useful to you, please mark it as answer. Thank you!
  • Re: Creating MailBox using CDOEXM in asp.net

    06-26-2008, 12:59 AM
    • Loading...
    • MustaqAhmed
    • Joined on 06-17-2008, 8:18 AM
    • Posts 3

    Thanks for replying I am including the code for your reference please check and let me know the cause for error

    sFirstName="abc";
      sLastName="def";
      sMailId="abc.def"
      sPassword="abc1234";
      strFullName=sFirstName+" "+sLastName;
                string domain = "LDAP://192.168.5.62/OU=newusers,DC=xxx,DC=com";           
                DirectoryEntry dirEntry = new DirectoryEntry(domain, "username", "password", AuthenticationTypes.Secure);
                sAccountName = sFirstName + "." + sLastName;
                DirectoryEntry newUser = dirEntry.Children.Add("CN=" + sMailId, "user");           
                newUser.Properties["givenname"].Add(strFirstname);
                newUser.Properties["sn"].Add(strLastName);           
                string strFullName = textInfo.ToTitleCase(sMailId);
                newUser.Properties["displayName"].Add(strFullName);
                newUser.Properties["SAMAccountName"].Add(sAccountName);           
                newUser.Properties["userPrincipalName"].Add(sAccountName+"@aaa.com");
                newUser.Properties["submissionContLength"].Add(5500);                 
                newUser.Properties["delivContLength"].Add(5500);              
                newUser.CommitChanges();
                EnableUserAccount(newUser);
                newUser.Invoke("SetPassword", new object[] { sPassword });
                newUser.CommitChanges();
                System.Threading.Thread.Sleep(10000);    
                //Till here working fine...
                string homeMDB = "CN=Mailbox Store(MAILBOX),CN=First Storage Group,CN=InformationStore,CN=MAILBOX,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=xxxxx,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=xxxx,DC=com";          
                CDOEXMailBox = (IMailboxStore)newUser.NativeObject;                     
                CDOEXMailBox.CreateMailbox(homeMDB);//Getting error at this stage
                newUser.CommitChanges();
               
                192.168.5.62=Server where Activer Directory is installed
                MAILBOX(192.168.5.60)=Server where Exchange server is installed..my application also hosted on this server

    please note that we have installed Active Directory and Exchange server installed on two different machines.

  • Re: Creating MailBox using CDOEXM in asp.net

    07-22-2008, 4:55 PM
    • Loading...
    • johram
    • Joined on 06-13-2006, 10:36 AM
    • Sweden
    • Posts 3,352
    • Moderator

    Hi there, sorry for the delay in getting back to you. Did you manage to solve this yet?

    If this post was useful to you, please mark it as answer. Thank you!
  • Re: Creating MailBox using CDOEXM in asp.net

    07-23-2008, 12:25 AM
    • Loading...
    • MustaqAhmed
    • Joined on 06-17-2008, 8:18 AM
    • Posts 3
    I didn't get solution for that till now..please help me...
Page 1 of 1 (5 items)
Microsoft Communities
Page view counter