• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2666
  • Last Modified:

Error reconnecting user mailbox

On a disconnected mailbox - I get the following error:

Summary: 1 item(s). 0 succeeded, 1 failed.
Elapsed time: 00:00:06


Stafford, Troy
Failed

Error:
The LegacyExchangeDN "/O=AUBURNSD/OU=FIRST ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=TSTAFFORD" of "3c0a6c23-b053-454a-8219-006fa8c9fec8" is being used by the following user in Active Directory: "Stafford, Troy". The value for LegacyExchangeDN must be unique to each user.

Exchange Management Shell command attempted:
Connect-Mailbox -Identity '3c0a6c23-b053-454a-8219-006fa8c9fec8' -Database 'admex1svr.asd.auburn.wednet.edu\MBX Storage Group 01\MBX01' -User 'asd\z10' -Alias 'z10'

Elapsed Time: 00:00:06
*************************************************************

How do I fix this?  I tried reconnecting it to a generic user without the same name just to get it "active" again but it still fails.  How can I fix it or assign a different LegacyExchangeDN?

0
jenmilks
Asked:
jenmilks
  • 3
  • 3
1 Solution
 
JimboEfxCommented:
Does the original mailbox owner (Stafford, Troy) still exist in AD?
0
 
jenmilksAuthor Commented:
No user doesn't exist.  Tried re-creating it and reconnecting but it gives this error, I don't know why.

I see the tool, but it seems to change things across the whole Exchange site, I don't want to do that, just this one mailbox.  Will this tool do that?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
JimboEfxCommented:
The only reason I can think of the error message is that the legacyexchangeDN is still in AD for a user account

If you are ok with scripting i have written a script to enumerate all exchange legacyDNs for all users

Save as vbs file - may need to be run from exchange server (tested with exchange 2003).

Change Set domainObject = GetObject("LDAP://OU=someOU,DC=somedomain,DC=ad") to reflect the topmost container for your AD.

It will produce a file with all legacyDNs, you can the search and find for the one in the error and see if it still exists somewhere.
Option Explicit
 
Dim fs
Dim UserFile
 
Dim rootDSE, domainObject
Set domainObject = GetObject("LDAP://OU=someOU,DC=somedomain,DC=ad")
 
 
Set fs = CreateObject ("Scripting.FileSystemObject") 
Set userFile = fs.CreateTextFile ("AddressList.csv")
 
on error resume next
 
ExportUsers(domainObject)
 
Wscript.Echo "Finished"
WScript.Quit
 
 
Sub ExportUsers(oObject)
Dim oUser
 
  For Each oUser in oObject
	Select Case oUser.Class
		Case "user"
			Wscript.Echo "Object User= " & oUser.Get("distinguishedName")
			Dim UserOUPath
			Dim ln
			Dim userdn
			Dim mail
 
			userdn = oUser.Get("distinguishedName")
			ln = (Len(userdn) - Len("CN=" & oUser.Get("cn"))) - 1
			UserOUPath = Right(userdn, ln)	
			Wscript.Echo UserOUPath
 
			if oUser.mail <> "" then
				on error resume next
				userFile.WriteLine oUser.Get("LegacyExchangeDN")			
			end if
 
		Case "organizationalUnit", "container"
			Wscript.Echo "Object OU= " & oUser.Get("distinguishedName")
			ExportUsers(oUser)
	End select
  Next
 
End Sub

Open in new window

0
 
jenmilksAuthor Commented:
Thanks for this, this is Exchange 2007 and the script doesn't appear to run.

I appreciate your time.
0
 
jenmilksAuthor Commented:
Implementing the script doesn't work for me.  The LegacyDN application doesn't reference Exchange 2007 - didn't find a solution on this one really.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now