cancel
Showing results for 
Search instead for 
Did you mean: 

EV SQL Query to list Mailbox display name, Exchange server name, Mailbox Database name, Vault store name & OU?

rajesh_velagapu
Level 4

EV SQL Query to list Mailbox display name, Exchange server name, Mailbox Database name, Vault store name
& OU?

1 ACCEPTED SOLUTION

Accepted Solutions

JesusWept3
Level 6
Partner Accredited Certified
SELECT EME.MbxDisplayName "Mailbox Name",
       ESE.ExchangeComputer "Exchange Server",
       EMS.Name "Exchange Database",
       EME.AdMbxDN "AD Details",
       VSE.VaultStoreName "Vault Store"
FROM   ExchangeMailboxEntry EME,
       ExchangeMailboxStore EMS,
       ExchangeServerEntry ESE,
       Root R,
       Archive A,
       VaultStoreEntry VSE
WHERE  EME.MbxStoreIdentity = EMS.MbxStoreIdentity
  AND  EMS.ExchangeServerIdentity = ESE.ExchangeServerIdentity
  AND  EME.DefaultVaultId = R.VaultEntryId
  AND  R.RootIdentity = A.RootIdentity
  AND  A.VaultStoreEntryId = VSE.VaultStoreEntryId
ORDER BY ESE.ExchangeComputer, EMS.Name, EME.MbxDisplayName

AD Details column will give a result like
CN=My User,OU=Accounting,OU=Company OUs,DC=ENTERPRISE,DC=VAULT

The OU after the name will be the OU they belong to, and the OU after is the OU that contains that OU etc

 

https://www.linkedin.com/in/alex-allen-turl-07370146

View solution in original post

3 REPLIES 3

JesusWept3
Level 6
Partner Accredited Certified
SELECT EME.MbxDisplayName "Mailbox Name",
       ESE.ExchangeComputer "Exchange Server",
       EMS.Name "Exchange Database",
       EME.AdMbxDN "AD Details",
       VSE.VaultStoreName "Vault Store"
FROM   ExchangeMailboxEntry EME,
       ExchangeMailboxStore EMS,
       ExchangeServerEntry ESE,
       Root R,
       Archive A,
       VaultStoreEntry VSE
WHERE  EME.MbxStoreIdentity = EMS.MbxStoreIdentity
  AND  EMS.ExchangeServerIdentity = ESE.ExchangeServerIdentity
  AND  EME.DefaultVaultId = R.VaultEntryId
  AND  R.RootIdentity = A.RootIdentity
  AND  A.VaultStoreEntryId = VSE.VaultStoreEntryId
ORDER BY ESE.ExchangeComputer, EMS.Name, EME.MbxDisplayName

AD Details column will give a result like
CN=My User,OU=Accounting,OU=Company OUs,DC=ENTERPRISE,DC=VAULT

The OU after the name will be the OU they belong to, and the OU after is the OU that contains that OU etc

 

https://www.linkedin.com/in/alex-allen-turl-07370146

Ameen
Level 6

Try the below query against 'Directory Database',

select MbxDisplayName [Display Name]

       ,ServerName [Exchange Server]

       ,Name [Mailbox Database]

       ,VaultStoreName [Vault Store Name]

       ,ADMbxDN [OU]

From [EnterpriseVaultDirectory].[dbo].[ExchangeMailboxEntry]

     ,[EnterpriseVaultDirectory].[dbo].[ExchangeMailboxStore]

     ,[EnterpriseVaultDirectory].[dbo].[VaultStoreEntry]

 

 

rajesh_velagapu
Level 4

Thanks!!!