Archive Active Directory Connector Service error dbo.MailStoreSelectByDistinguishedName returned more than one result. in Archive Active Directory Connector Service.exe.log file and in Event Viewer.
The full error code looks like:
AfterMail.Common.Util.SearchResultsNotUniqueException: dbo.MailStoreSelectByDistinguishedName returned more than one result.
at AfterMail.CommonClasses.SqlHelper.ExecuteDataRow(SqlCommand sqlCommand)
at AfterMail.BusinessLayer.MailStore.FindDistinguishedName(String distinguishedName)
at AfterMail.DirectoryConnector.ActiveDirectoryConnector.GetMailBox(DirectoryEntry rootEntry, DirectoryEntry mailBoxEntry, SqlConnection sqlConnection)
2009-04-07 07:54:38,652 [6] INFO ActiveDirectoryConnector - ArchiveMgr_service
2009-04-07 07:54:38,668 [6] INFO ActiveDirectoryConnector - AfterMail.Common.Util.SearchResultsNotUniqueException: dbo.MailStoreSelectByDistinguishedName returned more than one result.
at AfterMail.CommonClasses.SqlHelper.ExecuteDataRow(SqlCommand sqlCommand)
at AfterMail.BusinessLayer.MailStore.FindDistinguishedName(String distinguishedName)
at AfterMail.DirectoryConnector.ActiveDirectoryConnector.GetMailBox(DirectoryEntry rootEntry, DirectoryEntry mailBoxEntry, SqlConnection sqlConnection)
Duplicate entries of mailbox store are recorded in the database, it causes the stored procedure dbo.MailStoreSelectByDistinguishedName to fail.
RESOLUTION:
Note: Ensure that a backup of SQL ArchiveManager database exists prior to following below steps.
Reset the mailstore table so that the Archive Active Directory Connector Service can repopulate it correctly:
1) Stop all running Archive Manager services
2) Run the following SQL statement to reset the table:
use ArchiveManager
update mailbox set mailstoreID = null
delete from mailstore
3) Start Archive Active Directory Connector Service only.
Review the Archive Active Directory Connector Service.exe.log file or Event Viewer to make sure the error does not reappear.
Archive Active Directory Connector Service will repopulate the mailstore table and repopulate the mailstoreID in the mailbox table.
4) Once the Archive Active Directory Service has repopulated the mailstore table you can then start all other Archive Manager services.
If you also receive the error:
An error occured running a SQL statement. Dumping the SqlCommand.
The Exception message was: [MailBox Record failed to update, it may have been updated by another user.] and it occured at:
System.Data.SqlClient.SqlException: MailBox Record failed to update, it may have been updated by another user.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
Please see: https://support.quest.com/Search/SolutionDetailPrintView.aspx?id=SOL25594