locked
Combining get-mailbox with get-mailboxstatistics output RRS feed

  • Question

  • Trying to extract mailboxes that are not using the database defaults and include their name, database and quota information.    That is fine I can get all of that from get-mailbox -

    "Get-Mailbox -ResultSize unlimited | where {$_.UseDatabasequotadefaults -ne "true"} | select displayname, database,issuewarningquota,prohibitsendquota"

    And pipe to a file.

    What I would like to include is the totalitemsize (size of mailbox) include with this which is only available from Get-MailboxStatistics.    How can I include this in my above code ?

    Thanks in advance!

    

    Wednesday, March 20, 2013 3:09 PM

Answers

  • You'll have to script it because you're going to have to combine data from two different cmdlets (Get-Mailbox and Get-MailboxStatistics) into the output.  You'll have to write a loop based on the results of Get-Mailbox, save the properties from each cmdlet you want, then write them to the CSV.

    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

    • Proposed as answer by wendy_liu Monday, April 1, 2013 2:42 AM
    • Marked as answer by wendy_liu Wednesday, April 3, 2013 4:48 AM
    Wednesday, March 20, 2013 5:31 PM

All replies

  • You'll have to script it because you're going to have to combine data from two different cmdlets (Get-Mailbox and Get-MailboxStatistics) into the output.  You'll have to write a loop based on the results of Get-Mailbox, save the properties from each cmdlet you want, then write them to the CSV.

    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

    • Proposed as answer by wendy_liu Monday, April 1, 2013 2:42 AM
    • Marked as answer by wendy_liu Wednesday, April 3, 2013 4:48 AM
    Wednesday, March 20, 2013 5:31 PM
  • Thanks Ed - I was thinking I could pipe the two cmdlets together - which I have done in the past.   Hmmm ... got any hints or templates I could run with and modify to include the above desired results ?
    Wednesday, March 20, 2013 9:54 PM
  • Hi,

    Just as Ed's advise, you have to use script to combine the results of two cmdlets, because the results you want have to use two cmdlets to get.


    Wendy Liu
    TechNet Community Support

    Monday, April 1, 2013 2:42 AM