Move mailbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Trying to use the code below to move a users mailbox but keep getting the
helpfull "Catastrophic error" message on the line
"objMailbox.MoveMailbox(sMDB)". Anyone have a clue what i am doing wrong?



Dim dsUser As New DirectoryEntry("LDAP://" & AppSettings("PDC") & "/" &
GetAttribute("DistinguishedName", "Samaccountname", m_samAccountName))

Dim sMDB As String

Try

Dim objMailbox As CDOEXM.IMailboxStore

objMailbox = dsUser.NativeObject

sMDB = "LDAP://" & AppSettings("PDC") & "/" &
getHomeMDBURL(sNewServer)

' sMDB = getHomeMDBURL(sNewServer)

' sMDB = "LDAP://" & getHomeMDBURL(sNewServer)

objMailbox.MoveMailbox(sMDB)

dsUser.CommitChanges()
 
Did you ever get this figured out, I am geting the same error and I have full
permissions.
 
Nope, I havent figured it but will have to work on it again shortly. Please
post if you find anything out and I will do the same.
 
I ended up doing it with DirectoryServices Invoke and it worked for me:

DirectoryEntry ent = new DirectoryEntry(path);
ent.Invoke("MoveMailbox",new object[]{homeMDB});
ent.CommitChanges();
ent.Close();

That doesnt make any sence to me since it should be doing exactly the same
thing.

Thanks.
 
Back
Top