Invalid Schema Query for EX0MailboxDatabase when multiple EX0Servers are present

Coming across an issue with the schema query used by One Identity for EX0MailboxDatabase.

The environment is:

OneIM version 8.1.1

Exchange connector (Exch Server 2016 template)

Looking at the trace logs, the query it uses to query the EX0MailboxDatabase table is:

select XObjectKey, UID_EX0MailBoxDatabase, Name, xmarkedfordeletion from EX0MailBoxDatabase where (((ObjectKeySrvOrDAG = (select XObjectKey from ex0server where exchangeversion = '2016')) and ((UID_EX0Organization in (select UID_EX0Organization from EX0Organization where ((Name = 'Fulton Hogan Group')) and ((1=1))))))) order by Name

This throws the error "Database error 512: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression."

The offending part of the SQL query used looks to be (((ObjectKeySrvOrDAG = (select XObjectKey from ex0server where exchangeversion = '2016'))

Has anyone come across this and have a resolution?

  • Update: Looks like the issue is in the DPRSystemScopeFilter. The Filter column for EX0MailboxDatabase is set (by default I believe) to:

    #TCEXML-<TypeConfigExport Version="1.0">
    <Data Name="BaseVersion" Type="System.Int32, mscorlib">1</Data>
    <Data Name="NativeSystemFilter" Type="VI.Projector.Filter.SystemObjectNativeSystemFilter, VI.Projector">#TCEXML-&lt;TypeConfigExport Version="1.0"&gt;
    &lt;Data Name="Filter" Type="System.String, mscorlib"&gt;ObjectKeySrvOrDAG = (select XObjectKey from ex0server where exchangeversion = '2016')&lt;/Data&gt;
    &lt;/TypeConfigExport&gt;</Data>
    <Data Name="ObjectDataFilter" Type="VI.Projector.Filter.DefaultObjectDataFilter, VI.Projector">#TCEXML-&lt;TypeConfigExport Version="1.0"&gt;
    &lt;Data Name="BaseVersion" Type="System.Int32, mscorlib"&gt;1&lt;/Data&gt;
    &lt;Data Name="Negate" Type="System.Boolean, mscorlib"&gt;False&lt;/Data&gt;
    &lt;/TypeConfigExport&gt;</Data>
    <Data Name="ObjectFilter" Type="VI.Projector.Filter.DefaultObjectFilter, VI.Projector">#TCEXML-&lt;TypeConfigExport Version="1.0"&gt;
    &lt;Data Name="BaseVersion" Type="System.Int32, mscorlib"&gt;1&lt;/Data&gt;
    &lt;Data Name="Negate" Type="System.Boolean, mscorlib"&gt;False&lt;/Data&gt;
    &lt;/TypeConfigExport&gt;</Data>
    </TypeConfigExport>

    Changing the = to an IN resolves the issue, anyone know if there's a patch for this?