Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

Reconnect Method

Exchange Server 2003

The Reconnect method allows a disconnected mailbox to be reconnected to an existing user object in Microsoft Active Directory. The user must not already be mail-enabled.

Applies To

The Reconnect method is a member of the Exchange_Mailbox Class.

Instance Path

The Reconnect method appears on instances of the \\COMPUTERNAME\ROOT\MicrosoftExchangeV2:Exchange_Mailbox class.

MOF Syntax

[implemented] void Reconnect(
  [in] string UserLogonName);

Qualifiers

implemented

Parameters

ParameterDescription
UserLogonNameUserLogonName is a string (CIMTYPE=8) input parameter.

VBScript Example


'===============================================================
' Purpose:   Reconnect a Diconnected Exchange_Mailbox
'            to another user object
' Change:    cComputerName [string] the computer to access
' Change:    cDisconnectedMbox [string] the disconnected mailbox name
' Change:    cConnectTo [string] the user account to connect the mailbox to
'===============================================================

On Error Resume Next
Dim cComputerName
Dim cDisconnectedMbox
Dim cConnectTo
Dim objWMIService
Dim oDisMbox
Dim mBox
Const cWMINameSpace = "root/MicrosoftExchangeV2"
Const cWMIInstance = "Exchange_Mailbox"
cComputerName = "MyComputerNETBIOSName"
cDisconnectedMbox = "TestUserA"
cConnectTo = "TestUserB"

strWinMgmts = "winmgmts:{impersonationLevel=impersonate}!//"& _
cComputerName&"/"&cWMINameSpace
Set objWMIService = GetObject(strWinMgmts)
Set oDisMbox = objWMIService.ExecQuery("Select * from Exchange_Mailbox WHERE MailboxDisplayName = '" & cDisconnectedMbox & "'",,48)
For each mBox in oDisMbox
    mBox.Reconnect cConnectTo
    Wscript.Echo "Mailbox Reconnected"
Next

Remarks

When using the Reconnect method, the following limitations apply:

  1. It must run from the Exchange Server with the disconnected mailbox.
  2. You can not specify the domain for the reconnect attempt.
  3. The reconnect attempt will reconnect the mailbox to the first userid with a matching samaccountname in the forest.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.