Announcement

Collapse
No announcement yet.

Exchange 2010 - get-mailboxstats output to text file

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exchange 2010 - get-mailboxstats output to text file

    Hi folks - new user here.

    We are transitioning from Exchange 2003 to 2010. I'm looking for some help with creating my weekly mailbox statistics report under 2010.

    Under 2003, I would go into ESM, drill down to each mailbox db, display the columns I wanted, then export the list to a text file. Then I'd bring each text file into Excel and sort everything and create my report.

    I'm having issues with doing this under Exchange 2010.

    I read Pat Richard's wonderful article, "Getting Mailbox Sizes in Powershell", but I can't figure out how to direct the results of the command to a text file or CSV file so that I can pull it into Excel properly. Part of the issue is that there's a comma in one of the fields I'm displaying - DisplayName.

    Can anyone offer any help in this matter?

    Thanks in advance.

    -RAM

  • #2
    Re: Exchange 2010 - get-mailboxstats output to text file

    Obviously the comma is breaking DisplayName into two excel cells, so how about a simple formula to concatenate them back into one and then hide the original columns
    Something like (assuming name is in A1 and B1 and no spaces or anything except the ,)
    =A1&","&B1

    Is this the only issue you are having with the export?
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment


    • #3
      Re: Exchange 2010 - get-mailboxstats output to text file

      Thanks for the reply.

      If i just use out-file and port it to a text file, i can't find a common delimiter to specify in Excel for it to put things in separate columns (the objectclass field can contain a comma as well).

      Here's the command i'm trying to use:

      get-mailboxstatistics -database gfexdb02 | sort-object displayname | ft displayname, objectclass, @{expression={$_.totalitemsize.value.toKB()}}, itemcount, @{expression={$_.totaldeleteditemsize.value.toKB() }}, storagelimitstatus -auto | out-file -filepath c:\itservices\mailboxes\gfexdb02.txt

      This gets me the data i want, but it looks like i'm going to have to do a lot of clean-up on it before i can really do my stats report.

      I tried using export-csv instead of out-file, but that doesn seem to work at all. I get a larger output file, but it looks like this:

      "ClassId2e4f51ef21dd47e99d3c952918aff9cd","pageHea derEntry","pageFooterEntry","autosizeInfo","shapeI nfo","groupingEntry"
      "033ecb2bc07a4d43b5ef94ed5a35d280",,,"Microsoft.Po werShell.Commands.Internal.Format.AutosizeInfo","M icrosoft.PowerShell.Commands.Internal.Format.Table HeaderInfo",
      "9e210fe47d09416682b841769c78b8a3",,,,,
      "27c87ef9bbda4f709f6b4002fa4af63c",,,,,
      "27c87ef9bbda4f709f6b4002fa4af63c",,,,,
      "27c87ef9bbda4f709f6b4002fa4af63c",,,,,
      [truncated to save space in post]

      I'm not sure what the export-csv is doing.

      Your help is appreciated.

      -RAM

      Comment


      • #4
        Re: Exchange 2010 - get-mailboxstats output to text file

        Dont know if it helps, but here is one that exports to CSV in Exch2007-- you will need to adapt the fields
        get-mailbox | get-mailboxstatistics | select-object servername, databasename, DisplayName, @{expression={$_.TotalItemSize.Value.ToKB()}},Stor ageLimitStatus,LastLogonTime, LastLoggedOnUserAccount,ItemCount, DeletedItemCount | export-csv c:\exchangeuserstats.csv
        I got the field names with
        get-mailbox | get-mailboxstatistics | select-object *
        Tom Jones
        MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
        PhD, MSc, FIAP, MIITT
        IT Trainer / Consultant
        Ossian Ltd
        Scotland

        ** Remember to give credit where credit is due and leave reputation points where appropriate **

        Comment


        • #5
          Re: Exchange 2010 - get-mailboxstats output to text file

          SWEET! Now I got it to give me what I want.

          THANK YOU!!

          -RAM

          Comment


          • #6
            Re: Exchange 2010 - get-mailboxstats output to text file

            No problem
            Could you post your final script to help anyone else who needs it?
            Tom Jones
            MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
            PhD, MSc, FIAP, MIITT
            IT Trainer / Consultant
            Ossian Ltd
            Scotland

            ** Remember to give credit where credit is due and leave reputation points where appropriate **

            Comment

            Working...
            X