Forum Discussion

172pilotsteve's avatar
15 years ago

List of EV powershell commands???

Is there a place you can point me to, which would have a list of the cmdlets that the EV powershell extensions implement?   I have seen NUMEROUS references to the backup commands to put EV in and out of read only mode, but I can't find a comprehesive list of all of the EV cmdlets...

All I'm trying to do is to get a list of defined EV users, along with what server their EV store is on, *AND* their exchange server.

Thanks!!
-Steve
  •  172pilotsteve,

    Hi you cannot get what you want from powershell. You will need to use SQL, here is a SQL script that will get what you need :)

    SELECT 
    MbxDisplayName AS 'Mailbox',
    ExchangeComputer AS 'Exchange Server',
    MbxItemCount AS '#Items (Mailbox)',
    VS1.ArchivedItems AS '#Items (Archive)',
    MbxSize/1024 AS 'Mbx Size (MB)',
    VS1.ArchivedItemsSize/1024 AS  'Archive Size(MB)',
    (mbxsize+VS1.ArchivedItemsSize)/1024 AS 'Total Size(MB)',
    VS1.CreatedDate AS 'Archive Created',
    VS1.ModifiedDate AS 'Archive Updated', 
    MbxExchangeState AS 'Exchange State'
    FROM
    EnterpriseVaultDirectory.dbo.ExchangeMailboxEntry AS EME,
    EnterpriseVaultDirectory.dbo.ExchangeServerEntry AS ESE,
    EVMailboxVS01..ArchivePoint AS VS1
    WHERE
    EME.DefaultVaultID  = VS1.ArchivePointID AND
    EME.MbxArchivingState = 1 AND
    EME.ExchangeServerIdentity = ESE.ExchangeServerIdentity
    You will need to add your vault store name which I highlighted in bold, if you have multiple vault stores you can union them:
    SELECT 
    MbxDisplayName AS 'Mailbox',
    ExchangeComputer AS 'Exchange Server',
    MbxItemCount AS '#Items (Mailbox)',
    VS1.ArchivedItems AS '#Items (Archive)',
    MbxSize/1024 AS 'Mbx Size (MB)',
    VS1.ArchivedItemsSize/1024 AS  'Archive Size(MB)',
    (mbxsize+VS1.ArchivedItemsSize)/1024 AS 'Total Size(MB)',
    VS1.CreatedDate AS 'Archive Created',
    VS1.ModifiedDate AS 'Archive Updated', 
    MbxExchangeState AS 'Exchange State'
    FROM
    EnterpriseVaultDirectory.dbo.ExchangeMailboxEntry AS EME,
    EnterpriseVaultDirectory.dbo.ExchangeServerEntry AS ESE,
    EVMailboxVS01..ArchivePoint AS VS1
    WHERE
    EME.DefaultVaultID  = VS1.ArchivePointID AND
    EME.MbxArchivingState = 1 AND
    EME.ExchangeServerIdentity = ESE.ExchangeServerIdentity
    UNION
    SELECT 
    MbxDisplayName AS 'Mailbox',
    ExchangeComputer AS 'Exchange Server',
    MbxItemCount AS '#Items (Mailbox)',
    VS1.ArchivedItems AS '#Items (Archive)',
    MbxSize/1024 AS 'Mbx Size (MB)',
    VS1.ArchivedItemsSize/1024 AS  'Archive Size(MB)',
    (mbxsize+VS1.ArchivedItemsSize)/1024 AS 'Total Size(MB)',
    VS1.CreatedDate AS 'Archive Created',
    VS1.ModifiedDate AS 'Archive Updated', 
    MbxExchangeState AS 'Exchange State'
    FROM
    EnterpriseVaultDirectory.dbo.ExchangeMailboxEntry AS EME,
    EnterpriseVaultDirectory.dbo.ExchangeServerEntry AS ESE,
    EVMailboxVS01..ArchivePoint AS VS1
    WHERE
    EME.DefaultVaultID  = VS1.ArchivePointID AND
    EME.MbxArchivingState = 1 AND
    EME.ExchangeServerIdentity = ESE.ExchangeServerIdentity
    ORDER by Mailbox

7 Replies

  • If you run 'get-command' from within the EV shell, it will produce the list of commandlets available in powershell and those provided by the loaded console (evshell).

    Doing such I see the following:
    set/clear - Indexlocation/vaultstorebackupmode
    get-indexlocation/vaultstorebackupmode
    start-partitionrollover
    remove-EVExchangeFolderPolicy

    The tasks you are trying to perform appear to not exist within the EV shell currently.
    If you want additional info on any of these commands, run help <commandlet-name>  ie: help start-partitionrollover.

    Unfortunately, what you are trying to do appears not to be available through the EV shell at this point.
  •  172pilotsteve,

    Hi you cannot get what you want from powershell. You will need to use SQL, here is a SQL script that will get what you need :)

    SELECT 
    MbxDisplayName AS 'Mailbox',
    ExchangeComputer AS 'Exchange Server',
    MbxItemCount AS '#Items (Mailbox)',
    VS1.ArchivedItems AS '#Items (Archive)',
    MbxSize/1024 AS 'Mbx Size (MB)',
    VS1.ArchivedItemsSize/1024 AS  'Archive Size(MB)',
    (mbxsize+VS1.ArchivedItemsSize)/1024 AS 'Total Size(MB)',
    VS1.CreatedDate AS 'Archive Created',
    VS1.ModifiedDate AS 'Archive Updated', 
    MbxExchangeState AS 'Exchange State'
    FROM
    EnterpriseVaultDirectory.dbo.ExchangeMailboxEntry AS EME,
    EnterpriseVaultDirectory.dbo.ExchangeServerEntry AS ESE,
    EVMailboxVS01..ArchivePoint AS VS1
    WHERE
    EME.DefaultVaultID  = VS1.ArchivePointID AND
    EME.MbxArchivingState = 1 AND
    EME.ExchangeServerIdentity = ESE.ExchangeServerIdentity
    You will need to add your vault store name which I highlighted in bold, if you have multiple vault stores you can union them:
    SELECT 
    MbxDisplayName AS 'Mailbox',
    ExchangeComputer AS 'Exchange Server',
    MbxItemCount AS '#Items (Mailbox)',
    VS1.ArchivedItems AS '#Items (Archive)',
    MbxSize/1024 AS 'Mbx Size (MB)',
    VS1.ArchivedItemsSize/1024 AS  'Archive Size(MB)',
    (mbxsize+VS1.ArchivedItemsSize)/1024 AS 'Total Size(MB)',
    VS1.CreatedDate AS 'Archive Created',
    VS1.ModifiedDate AS 'Archive Updated', 
    MbxExchangeState AS 'Exchange State'
    FROM
    EnterpriseVaultDirectory.dbo.ExchangeMailboxEntry AS EME,
    EnterpriseVaultDirectory.dbo.ExchangeServerEntry AS ESE,
    EVMailboxVS01..ArchivePoint AS VS1
    WHERE
    EME.DefaultVaultID  = VS1.ArchivePointID AND
    EME.MbxArchivingState = 1 AND
    EME.ExchangeServerIdentity = ESE.ExchangeServerIdentity
    UNION
    SELECT 
    MbxDisplayName AS 'Mailbox',
    ExchangeComputer AS 'Exchange Server',
    MbxItemCount AS '#Items (Mailbox)',
    VS1.ArchivedItems AS '#Items (Archive)',
    MbxSize/1024 AS 'Mbx Size (MB)',
    VS1.ArchivedItemsSize/1024 AS  'Archive Size(MB)',
    (mbxsize+VS1.ArchivedItemsSize)/1024 AS 'Total Size(MB)',
    VS1.CreatedDate AS 'Archive Created',
    VS1.ModifiedDate AS 'Archive Updated', 
    MbxExchangeState AS 'Exchange State'
    FROM
    EnterpriseVaultDirectory.dbo.ExchangeMailboxEntry AS EME,
    EnterpriseVaultDirectory.dbo.ExchangeServerEntry AS ESE,
    EVMailboxVS01..ArchivePoint AS VS1
    WHERE
    EME.DefaultVaultID  = VS1.ArchivePointID AND
    EME.MbxArchivingState = 1 AND
    EME.ExchangeServerIdentity = ESE.ExchangeServerIdentity
    ORDER by Mailbox
  • This query is probably more suited for you than the query above, for the fact that if all you want is the name, exchange server and evserver, you wont have to worry about running selects against each vault store

    SELECT EME.MbxDisplayName AS MailboxName, ESE.ExchangeComputer AS ExchangeServer, CE.ComputerName AS EVServer, VSE.VaultStoreName AS VaultStore
    FROM ExchangeMailboxEntry EME,
         Root R,
         Archive A,
         VaultStoreEntry VSE,
         ExchangeServerEntry ESE,
         ComputerEntry CE,
         StorageServiceEntry SSE
    WHERE EME.DefaultVaultId = R.VaultEntryId
      AND R.RootIdentity = A.RootIdentity
      AND A.VaultStoreEntryId = VSE.VaultStoreEntryId
      AND EME.ExchangeServerIdentity = ESE.ExchangeServerIdentity
      AND VSE.StorageServiceEntryId = SSE.ServiceEntryId
      AND SSE.ComputerEntryId = CE.ComputerEntryId
    ORDER BY EME.MbxDisplayName
  • Thanks!

    @Wayne H:  This worked great..  I've got some experience with SQL, but dont know the EV schema at all, and would NEVER have come up with this on my own..  Tweaking this, I now have one stored proc that I hope to call from Powershell, which has all the fields you showed, from all three servers, combined into one report, with the server it came from as an added field..  This should work nicely.

    @JesusWept2:  Thanks for the simpler idea too..  You're right - This would work, and I was going to use this, but once I saw all the other data I could grab, I figured it's better to have it and ignore it until someone asks for it than to have to revisit this later!!

    I'm trying to press the "Mark as solution" buttons, but they're not working for me..  I'll keep trying, but if someone needs to close this, then go for it!!

    -Steve
  • Can anyone tell me what updates this data?  I run the SQL query, and in the SQLdata returned, I have a field called "Exchange Server" which I assumed is the exchange server which houses that user's mailbox, but I have found that it does not show current information...

    if the intent is that the field I'm looking at shows where the mailbox was located when the vault was activated, then that's fine, but if it is meant to be dynamic data, and it's not updating, I need to find out why it's not updating, and/or if there are any other fields that aren't an instantaneous picture of the current reality, I'd love to know that too!!

    thanks a lot - other than this, the script is exactly what I'm looking for, and I've got an automated report that shows where every user is..

    -Steve
  • the Provisioning Task is what updates the ExchangeMailboxEntry table, sometimes you may have duplicate users listed in there if they move about as a new record may have been created as opposed to updating a record etc