Results 1 to 3 of 3

Thread: CreatMailBox throws "There is no such object on the server"

  1. #1
    JeffW Guest

    CreatMailBox throws "There is no such object on the server"

    It seems that this issue has been thrashed around a number of time but
    in my case, nothing seems to help. The code below actually worked fine
    last week. Got back to it on Monday and it won't run. (Note the
    variables prefaced wit h"g" are global and loaded wit hregistry values
    elswhere)

    I have checked the HomeMDBUrl 100 times and even pasted it from
    ADSIEdit as suggested elsewhere. I also check the permissions on the
    Exchange Administrator group and tried various user accounts. I also
    cannot find and logging anywhere that might give me a hint as to what
    is going on.

    Private Sub CreateMailBox(ByRef User As OAC_UI_Objects.cUI_User)

    ' strHomeMDBUrl should look like this
    Try
    Dim strHomeMDBUrl As String = "CN=" & gMailBoxStore & ",CN=First
    Storage Group," & _
    "CN=InformationStore,CN=" & gExchangeServer & ",CN=Servers," & _
    "CN=First Administrative Group,CN=Administrative Groups," & _
    "CN=" & gExch_OU & ",CN=Microsoft
    Exchange,CN=Services,CN=Configuration," & _
    "DC=" & gFullDomain

    'Create an ADSI User

    Dim oPerson As ActiveDs.IADsUser = GetObject("LDAP://CN=" &
    User.UserLogon & ",cn=Users,DC=" & gFullDomain)

    Dim oMailbox As CDOEXM.IMailboxStore
    Dim strUserName As String
    strUserName = User.UserLogon
    ' Create a mailbox.
    oMailbox = oPerson
    oMailbox.CreateMailbox(strHomeMDBUrl)

    ' Save.
    oPerson.SetInfo()
    oPerson = GetObject("LDAP://CN=" & User.UserLogon &
    ",cn=Users,DC=" & gFullDomain)
    'Update the User
    User.ExchEmail = oPerson.EmailAddress

    'Log the creation of the mailbox
    EventLog.WriteEntry("AD", "An Exchange Mailbox was
    successfully created for " & User.UserLogon & ". Their E-Mail address
    is " & oPerson.EmailAddress, EventLogEntryType.Information)

    ' Clean up.
    oPerson = Nothing
    oMailbox = Nothing

    Catch ex As Exception
    EventLog.WriteEntry("AD", ex.ToString,
    EventLogEntryType.Error)

    End Try
    End Sub

    If anyone has any ideas, I'm all ears.
    Jeff

  2. #2
    JeffW Guest
    OK, I fixed it. This is a combination of "Duh!!" and stupid coding in
    the library. The problem was that in the HomeMDBUrl I didn't have a
    space between the "Mailbox Store" and the "(" for the server name.
    Added the space and all's right with the world until.......I changed
    the actual Mailbox Store from the default "Mailbox Store" to a
    different store that my client wants to use for Students (It's a
    college). If you use the default "MailBox Store" you MUST include the
    server name enclosed in parens "(Servername )" and there MUST be a
    space between "...Store" and "(". If you specify a different MailBox
    Store like "Student_MailboxStore" you MUST NOT include the server name
    at all and no Parens "( )".

    This is the kind of frustration that I think almost everyone runs into
    with ADSI coding. There really needs to be better error handling as
    well as better coding consistancy in the libraries. This make it look
    like CDOEXM was coded by a committee in different parts of the
    world...Ummmm....out-sourcing perhaps?

    Always learning
    Jeff

  3. #3
    JeffW Guest
    OK, I fixed it. This is a combination of "Duh!!" and stupid coding in
    the library. The problem was that in the HomeMDBUrl I didn't have a
    space between the "Mailbox Store" and the "(" for the server name.
    Added the space and all's right with the world until.......I changed
    the actual Mailbox Store from the default "Mailbox Store" to a
    different store that my client wants to use for Students (It's a
    college). If you use the default "MailBox Store" you MUST include the
    server name enclosed in parens "(Servername )" and there MUST be a
    space between "...Store" and "(". If you specify a different MailBox
    Store like "Student_MailboxStore" you MUST NOT include the server name
    at all and no Parens "( )".

    This is the kind of frustration that I think almost everyone runs into
    with ADSI coding. There really needs to be better error handling as
    well as better coding consistancy in the libraries. This make it look
    like CDOEXM was coded by a committee in different parts of the
    world...Ummmm....out-sourcing perhaps?

    Always learning
    Jeff

Similar Threads

  1. Replies: 6
    Last Post: 12-05-2005, 09:58 AM
  2. sp2 installed no IMF object on SMPT virtual server
    By news.microsoft.com in forum Administration
    Replies: 2
    Last Post: 11-15-2005, 01:58 AM
  3. Removing a crashed Exchange Server 2003 Object
    By Buchi in forum Administration
    Replies: 3
    Last Post: 09-27-2005, 09:58 AM
  4. unable to find the Exchange server object
    By Todd in forum Administration
    Replies: 2
    Last Post: 09-16-2005, 05:59 PM
  5. Replies: 0
    Last Post: 06-03-2005, 10:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - CAD Forum