Quentin,

CDOEXM allows mailbox movements, here is a (relatively) unchecked code
snippet. Obviously the line breaks have been mseed up.

Sub ADSIMoveMailbox(recipname As String, DestinationServer As String,
MailBoxStore As String, StorageGroup As String)

Dim objUser As IADsUser
Dim objMailbox As CDOEXM.IMailboxStore
Dim strMove As String
Dim exchPath

On Error GoTo errorhandler

Set objUser = GetObject(recipname)
Set objMailbox = objUser
If objMailbox.HomeMDB <> "" Then
    exchPath = DestinationServer
    If exchPath <> "" Then
       strMove = "cn=" + MailBoxStore + ",cn=" + StorageGroup +
",cn=InformationStore," + exchPath
        MsgBox "Now Moving:" & objUser.Name
       objMailbox.MoveMailbox strMove <-- This does all the work
       objUser.SetInfo
       MsgBox "Move Mailbox operation has been completed for user " +
recipname
    Else
       MsgBox "FAIL :Server " + DestinationServer + " not found"
    End If
Else
     MsgBox "FAIL: no mailbox to move for " + recipname
End If
On Error Goto 0
GoTo EndofItAll
errorhandler:
    If Err <> 0 Then
       MsgBox "FAIL: Move Mailbox Error while moving user " + recipname + ".
Error Code is " + Str(Err)
       Exit Sub
    End If
EndofItAll:
End Sub


HTH

Glenn

----- Original Message -----
From: "Quentin" <[EMAIL PROTECTED]>
To: "Exchange Discussions" <[EMAIL PROTECTED]>
Sent: Saturday, June 08, 2002 2:53 AM
Subject: RUS and Move Mailbox


> I am accessing Exchange properties via LDAP.
> When I create the attributes homeMDB, homeMTA, msExchHomeServerName and
> mailNickname, RUS successfully creates my mailbox.
>
> Now, I wonder if it is possible to MOVE my mailboxes as well.
> Only changing the values via LDAP will not do.
> Does any body know a way to move a mailbox (from a remote machine) using
> LDAP for example?
> CDOEX(M) API only seem to run locally... Or at least in the same domain.
>
> _________________________________________________________________
> List posting FAQ:       http://www.swinc.com/resource/exch_faq.htm
> Archives:               http://www.swynk.com/sitesearch/search.asp
> To unsubscribe:         mailto:[EMAIL PROTECTED]
> Exchange List admin:    [EMAIL PROTECTED]


_________________________________________________________________
List posting FAQ:       http://www.swinc.com/resource/exch_faq.htm
Archives:               http://www.swynk.com/sitesearch/search.asp
To unsubscribe:         mailto:[EMAIL PROTECTED]
Exchange List admin:    [EMAIL PROTECTED]

Reply via email to