Reconnect Method
Reconnect Method
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
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
Parameter | Description |
---|---|
UserLogonName | UserLogonName 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:
- It must run from the Exchange Server with the disconnected mailbox.
- You can not specify the domain for the reconnect attempt.
- The reconnect attempt will reconnect the mailbox to the first userid with a matching samaccountname in the forest.
Send us your feedback about the Microsoft Exchange Server 2003 SDK.
This topic last updated: July 2006
Build: June 2007 (2007.618.1)
© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.