Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
The Reconnect method is a member of the Exchange_Mailbox Class.
The Reconnect method appears on instances of the \\COMPUTERNAME\ROOT\MicrosoftExchangeV2:Exchange_Mailbox class.
[implemented] void Reconnect( [in] string UserLogonName);
implemented
Parameter | Description |
---|---|
UserLogonName | UserLogonName is a string (CIMTYPE=8) input parameter. |
'=============================================================== ' 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
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.