Forum Discussion

rajesh_velagapu's avatar
12 years ago

EV SQL Query to find Archive name, vault store & Exchange server?

EV SQL Query to find Archive name, vault store & Exchange server?

  • Try this:

    SELECT    
    ESE.ExchangeComputer,
    EME.MbxDisplayName,
    A.ArchiveName,
    VSE.VaultStoreName
    FROM         dbo.ExchangeMailboxEntry AS EME
    INNER JOIN     dbo.ExchangeMailboxStore EMS ON EMS.MbxStoreIdentity = EME.MbxStoreIdentity
    INNER JOIN   dbo.ExchangeServerEntry ESE ON ESE.ExchangeServerIdentity = EMS.ExchangeServerIdentity
    INNER JOIN   dbo.Root AS R ON R.VaultEntryId = EME.DefaultVaultId
    INNER JOIN   dbo.Archive AS A ON A.RootIdentity = R.RootIdentity
    INNER JOIN   dbo.VaultStoreEntry AS VSE ON VSE.VaultStoreEntryId = A.VaultStoreEntryId

    --- or ---

    SELECT ESE.ExchangeComputer, EME.MbxDisplayame, VSE.VaultStoreName
    FROM ExchangeMailboxEntry EME, Archive A, Root R, ExchangeServerEntry ESE, VaultStoreEntry VSE
    WHERE EME.ExchangeServerIdentity = ESE.ExchangeServerIdentity
    AND EME.DefaultVaultId = R.VaultEntryID
    AND R.RootIdentity = A.RootIdentity
    AND A.VaultStoreEntryId = VSE.VaultStoreEntryId
    ORDER BY ESE.ExchangeComputer, EME.MbxDisplayName

6 Replies

  • welcome back rajesh. how have you been? i remember providing this for you in the past so i should have it somewhere. are you still with the same company?

  • Try this:

    SELECT    
    ESE.ExchangeComputer,
    EME.MbxDisplayName,
    A.ArchiveName,
    VSE.VaultStoreName
    FROM         dbo.ExchangeMailboxEntry AS EME
    INNER JOIN     dbo.ExchangeMailboxStore EMS ON EMS.MbxStoreIdentity = EME.MbxStoreIdentity
    INNER JOIN   dbo.ExchangeServerEntry ESE ON ESE.ExchangeServerIdentity = EMS.ExchangeServerIdentity
    INNER JOIN   dbo.Root AS R ON R.VaultEntryId = EME.DefaultVaultId
    INNER JOIN   dbo.Archive AS A ON A.RootIdentity = R.RootIdentity
    INNER JOIN   dbo.VaultStoreEntry AS VSE ON VSE.VaultStoreEntryId = A.VaultStoreEntryId

    --- or ---

    SELECT ESE.ExchangeComputer, EME.MbxDisplayame, VSE.VaultStoreName
    FROM ExchangeMailboxEntry EME, Archive A, Root R, ExchangeServerEntry ESE, VaultStoreEntry VSE
    WHERE EME.ExchangeServerIdentity = ESE.ExchangeServerIdentity
    AND EME.DefaultVaultId = R.VaultEntryID
    AND R.RootIdentity = A.RootIdentity
    AND A.VaultStoreEntryId = VSE.VaultStoreEntryId
    ORDER BY ESE.ExchangeComputer, EME.MbxDisplayName

  • Hi,

    Which Database to use ?

    I gotthis error: Msg 208, Level 16, State 1, Line 1

    Invalid object name 'exchangemailboxentry'.
  • Use EnterpriseVaultDirectory

    sorry i did notice a typo in the second script

    SELECT ESE.ExchangeComputer, EME.MbxDisplayame, VSE.VaultStoreName

    MbxDisplayname was missing the n

  • Yes that is correct Andrew, the query below is working fine:

     

    SELECT ESE.exchangecomputer, 
    
           EME.mbxdisplayname, 
    
           VSE.vaultstorename 
    
    FROM   exchangemailboxentry EME, 
    
           archive A, 
    
           root R, 
    
           exchangeserverentry ESE, 
    
           vaultstoreentry VSE 
    
    WHERE  EME.exchangeserveridentity = ESE.exchangeserveridentity 
    
           AND EME.defaultvaultid = R.vaultentryid 
    
           AND R.rootidentity = A.rootidentity 
    
           AND A.vaultstoreentryid = VSE.vaultstoreentryid 
    
    ORDER  BY ESE.exchangecomputer, 
    
              EME.mbxdisplayname 

    Thanks for the assistance.