Error calling Reconnect in WMI object Exchange_Mailbox

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<span style="font-family:Times New Roman; font-size:small
<span lang="EN-US" style="color:black I have a C# application that migrates MailboxStores from one user to another. When I try to reconnect the MailboxStore to the new user, a receive the error below:
<span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt

<span lang="EN-US" style="color:black There is no Connection Agreement configured to export this recipient to the Exchange 5.5 server.<br/>
Make sure you have the required permissions and/or you are running on the Exchange Server to invoke this method.<br/>
Facility: Microsoft Exchange Management <span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt

<span lang="EN-US" style="color:black The source code used for reconnecting is:<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt

<p style="margin:0cm 0cm 0pt <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt protected<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt
<span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt static<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt
<span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt ManagementScope<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt GetScope(<span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt String<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt
serverName)<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt {

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt ConnectionOptions<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt options =
<span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt new<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt
<span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt ConnectionOptions<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt ();<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt options.Impersonation =
<span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt ImpersonationLevel<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt .Impersonate;<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt options.EnablePrivileges =
<span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt true<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt ;<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt ManagementScope<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt scope =
<span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt new<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt
<span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt ManagementScope<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt (<span lang="EN-US" style="color:#a31515; font-family:"Courier New"; font-size:10pt "//"<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt
+ serverName + <span lang="EN-US" style="color:#a31515; font-family:"Courier New"; font-size:10pt "/root/MicrosoftExchangeV2:Exchange_Mailbox"<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt , options);<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt return<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt scope;<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt }

<p style="margin:0cm 0cm 0pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt // This routine returns the MailboxStore object for a GUID

<p style="margin:0cm 0cm 0pt <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt public<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt
<span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt static<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt
<span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt ManagementObject<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt GetExchangeMailbox(<span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt Guid<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt
guid, <span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt String<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt serverName)<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt {

<p style="margin:0cm 0cm 0pt 35.4pt <span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt ObjectQuery<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt query =
<span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt new<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt
<span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt ObjectQuery<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt (<span lang="EN-US" style="color:#a31515; font-family:"Courier New"; font-size:10pt "select
* from Exchange_Mailbox where MailboxGUID = "<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt +
<span lang="EN-US" style="color:#a31515; font-family:"Courier New"; font-size:10pt "{"<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt + guid.ToString().ToUpper() +
<span lang="EN-US" style="color:#a31515; font-family:"Courier New"; font-size:10pt "}"<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt +
<span lang="EN-US" style="color:#a31515; font-family:"Courier New"; font-size:10pt ""<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt );<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt ManagementObjectSearcher<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt searcher
= <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt new<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt
<span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt ManagementObjectSearcher<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt (GetScope(serverName), query);<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt ManagementObjectCollection<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt coll =
searcher.Get();<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt if<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt (coll.Count > 0)<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt {

<p style="margin:0cm 0cm 0pt 35.4pt; text-indent:35.4pt <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt foreach<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt (<span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:10pt ManagementObject<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt
obj <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt in<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt coll)<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt 35.4pt; text-indent:35.4pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt {

<p style="margin:0cm 0cm 0pt 70.8pt; text-indent:35.4pt <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt return<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt obj;<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt 35.4pt; text-indent:35.4pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt }

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt }

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt; text-indent:35.4pt <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt return<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt
<span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:10pt null<span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt ;<span lang="EN-US" style="color:black

<p style="margin:0cm 0cm 0pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt }

<p style="margin:0cm 0cm 0pt <span style="color:black; font-family:"MS Mincho"; font-size:10pt <span lang="EN-US" style="color:black; font-family:"Courier New"; font-size:10pt

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:9.5pt // This Routine reconnects the MailboxStore to the new user

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="color:blue; font-family:"Courier New"; font-size:9.5pt public<span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt
<span style="color:blue static <span style="color:#2b91af Boolean ReconnectMailbox(<span style="color:#2b91af ManagementObject mailbox,
<span style="color:#2b91af String userLogin)

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt {

<p style="margin:0cm 0cm 0pt; line-height:normal; text-indent:35.4pt <span lang="EN-US" style="color:#2b91af; font-family:"Courier New"; font-size:9.5pt Boolean<span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt reconnect =
<span style="color:blue true;

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt <span style="
<span style="color:#2b91af MessageBox.Show(<span style="color:#a31515 "ServerName = " + (<span style="color:#2b91af String)mailbox.Properties[<span style="color:#a31515 "ServerName"].Value);

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt <span style="
<span style="color:#2b91af MessageBox.Show(<span style="color:#a31515 "LegacyDN = " + (<span style="color:#2b91af String)mailbox.Properties[<span style="color:#a31515 "LegacyDN"].Value);

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt <span style="
mailbox.InvokeMethod(<span style="color:#a31515 "Reconnect", <span style="color:blue
new <span style="color:#2b91af Object[] { userLogin });

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt <span style="
<span style="color:blue return reconnect;

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt }

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt This program runs perfectly in development server, but not under production. The only differences are that in production we are a cluster
of servers, and different machines for AD and Exchange.

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt Under production, we are running Windows 2003 R2 SP2 and Exchange 2003 SP2, and under development we have Windows 2003 SP2 and Exchange 2003
SP2.

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt <span style="font-family:Times New Roman; font-size:small

<p style="margin:0cm 0cm 0pt; line-height:normal <span lang="EN-US" style="font-family:"Courier New"; font-size:9.5pt I donât have any more idea of how to fix this.<span lang="EN-US" style="
<span style="font-family:Times New Roman; font-size:small <font face="Times New Roman" size="3" style="font-family:Times New Roman; font-size:small

</font>

View the full article
 
Back
Top