Forum Discussion

San_Bangalore's avatar
10 years ago

SQL Journal Mailbox

We have Journaling environment, running Journaling for Exchange 2007 and EV version 10.0.4

I am looking for a SQL query which finds the target archive in Journal Mailbox Properties.

Targets - > Exchange - > domain - > Exchange server name - > Journal Mailbox - > Journal mailbox properties - > Archive

5 Replies

  • Hello,

    I am not sure what you are asking, but I believe you can use the directory database to run :

    select * from JournalingTarget

    that gives you the ExchangeMailboxEntryID, which can be used to run on the ExchangeMailboxEntry table:

    Select *

    From ExchangeMailboxEntry

    Where ExchangeMailboxEntryId = 'ExchangeMailboXEntryID'

    That gives you the Journal mbx name

  • select *

    from Archive

    Where ArchiveTypeIdentity = '3'

    Gives you all Journal Archives. I am not sure you can use SQL to find exactly what you need.

    When you run:

    select *

    from ExchangeMailboxEntry

    Where ExchangeMbxType = '2'

    That gives you the journalmailboxes, you can use the DefaultVaultId from the result to find the belonging archives?

  • Let's try following query:-

     

    USE EnterpriseVaultDirectory
    SELECT
        EME.MbxDisplayName,
        EME.MbxDisplayName,
        AV.ArchiveName,
        AV.VaultEntryId ArchiveID
    FROM ExchangeMailboxEntry EME
    INNER JOIN ArchiveView AV ON AV.VaultEntryId = EME.DefaultVaultId
    WHERE ExchangeMbxType = 2

  • Improving on Pradeep_Papnai's query, we use the following to get a simplified view of journal targets vs. archive names vs. journal tasks

     

    Use EnterpriseVaultDirectory
    SELECT e.MbxDisplayName,AV.ArchiveName,t.Name,ArchiveEnabled
    FROM [EnterpriseVaultDirectory].[dbo].[JournalingTarget] "j"
    JOIN [EnterpriseVaultDirectory].[dbo].[Task] "t" ON t.TaskEntryId = j.TaskEntryId
    JOIN [EnterpriseVaultDirectory].[dbo].ExchangeMailboxEntry "e" ON e.ExchangeMailboxEntryId = j.ExchangeMailboxEntryId
    INNER JOIN [EnterpriseVaultDirectory].[dbo].ArchiveView AV ON AV.VaultEntryId = e.DefaultVaultId
    Order by e.MbxDisplayName