Hello,
Thank you for specifying. The thing is Adaxes caches some properties of mailboxes that reside in Exchange Online along with the mailbox GUIDs. As the account that is displayed as GUID was migrated from one forest to another, there are two sets of cached properties. Looks like Adaxes is trying to use the old set of cached properties to get the Active Directory account from the forest where it no longer exists. To remedy the issue, please, execute the below script in Windows PowerShell on the computer where Adaxes service is installed. The script clears cached property values for Extending objects (stored in Adaxes backend) if the corresponding account no longer exists in the domain. During the script execution, when prompted, provide credentials of the Adaxes service account (the ones specified during the installation).
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
# Connect to the Adaxes service
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("localhost")
# Prompt for credentials
$credential = Get-Credential
# Build search filter
$backendPortNumber = $admService.Backend.PortNumber
$searcher = $admService.OpenObject("Adaxes://localhost:$backendPortNumber/CN=Extending Objects,CN=Adaxes Configuration,CN=Adaxes", $credential.Username, $credential.GetNetworkCredential().Password, 0)
$searcher.SearchFilter = "(&(objectClass=adm-ExtendingObject)(objectClass=adm-User))"
$searcher.PageSize = 500
$searcher.SearchScope = "ADS_SCOPE_ONELEVEL"
try
{
# Execute search
$searchIterator = $searcher.ExecuteSearch()
$updatetedObjectsCount = 0
while ($True)
{
$searchResults = $searchIterator.GetNextPage()
foreach ($searchResult in $searchResults)
{
try
{
$guid = [Guid]$searchResult.Properties["cn"].Value
}
catch
{
continue
}
try
{
$object = $admService.OpenObject("Adaxes://<GUID=$guid>", $credential.Username, $credential.GetNetworkCredential().Password, 0)
}
catch
{
$object = $NULL
}
# Clear property values
if ($NULL -eq $object)
{
$extendingObject = $admService.OpenObject($searchResult.AdsPath, $credential.Username, $credential.GetNetworkCredential().Password, 0)
$extendingObject.Put("adm-O365ExchangeObjectId", $NULL)
$extendingObject.Put("adm-O365ExchangeRecipientType", $NULL)
$extendingObject.Put("adm-O365ExchangeRecipientTypeDetails", $NULL)
$extendingObject.Put("adm-O365LastKnownAssociatedTenantId", $NULL)
$extendingObject.Put("adm-O365ObjectId", $NULL)
try
{
$extendingObject.SetInfo()
$updatetedObjectsCount++
}
catch
{
$warning = "An error occurred when updateting extening object $guid`. Error: " + $_.Exception.Message
Write-Warning $warning
}
}
}
if (($searchResults.Length -eq 0) -and ($searchIterator.IsSearchCompleted))
{
break # no more results to return
}
}
Write-Host "Updated objects count" $updatetedObjectsCount
}
finally
{
# Release resources
if ($searchIterator) { $searchIterator.Dispose() }
}