Exchange mailbox statistic

Posted on 2010-01-06
Last Modified: 2012-06-21
Hi, I'm a newbie in Exchange and I would like to know how to get the statictic of the users mailbox in the exchange like:

- Size (Capacity of mailboxs)
- Used
- Free

It is a Exchange 2003 and most info that i got onlinei s powershell (No idea of how to use it) for exchange 2007. Any idea on how to generate this report?
Question by:otyew
    LVL 22

    Accepted Solution


    ' Date:      December 23, 2005
    ' Author:    Scott Lowe, starting with a sample script downloaded from
    '            Microsoft
    ' Purpose:   Write the name of, size of, number of items in and status
    '            of each users Exchange mailbox to a CSV file
    ' Change:    cComputerName to the name of an Exchange server
    '            sOutFile to the name of the file you want to save to
    ' Output:    Displays the name of each Exchange_Mailbox's Size property
    ' Status:    1: Below Limit
    '            2: Issue Warning
    '            4: Prohibit Send
    '            8: No Checking
    '            16: Mailbox Disabled
    On Error Resume Next
    Dim cComputerName
    cComputerName = "w2k3-std" ' <---- Change this to your Exchange server
    Const cWMINameSpace = "root/MicrosoftExchangeV2"
    Const cWMIInstance = "Exchange_Mailbox"
    Dim oFSO             ' File system object to write to
    Dim oOutputFile            ' Output file object
    Dim sOutFile         ' Name of the output file
    sOutFile = "C:\Scripts\sample.csv" ' <---- Change this
    Dim sWinMgmts        ' Connection string for WMI
    Dim oWMIExchange     ' Exchange Namespace WMI object
    Dim lExchange_Mailboxes    ' ExchangeLogons collection
    Dim oExchange_Mailbox      ' A single ExchangeLogon WMI object
    ' Open the output file for writing
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    Set oOutputFile = oFSO.opentextfile(sOutFile, 2, True)
    'Write a heading into the output file
    oOutputFile.writeline("Mailbox name,Size (KB),# items,Status")
    ' Create the object string, indicating WMI (winmgmts), using the
    ' current user credentials (impersonationLevel=impersonate),
    ' on the computer specified in the constant cComputerName, and
    ' using the CIM namespace for the Exchange provider.
    sWinMgmts = "winmgmts:{impersonationLevel=impersonate}!//"& _
    Set oWMIExchange =  GetObject(sWinMgmts)
    ' Verify we were able to correctly set the object.
    If Err.Number <> 0 Then
      oOutputFile.writeline("ERROR: " & err.number & ", " & err.description)
      ' The Resources that currently exist appear as a list of
      ' Exchange_Mailbox instances in the Exchange namespace.
      Set lExchange_Mailboxes = oWMIExchange.InstancesOf(cWMIInstance)
      ' Were any Exchange_Mailbox Instances returned?
      If (lExchange_Mailboxes.count > 0) Then
        ' If yes, do the following:
        ' Iterate through the list of Exchange_Mailbox objects.
        For Each oExchange_Mailbox in lExchange_Mailboxes
           oOutputFile.writeline("""" & _ 
               oExchange_Mailbox.MailboxDisplayName & _ 
               """," & _
               oExchange_Mailbox.Size & _
               ","& _
               oExchange_Mailbox.TotalItems & _
               ","& _
        ' If no Exchange_Mailbox instances were returned,
        ' display that.
        oOutputFile.writeline("WARNING: No Exchange_Mailbox instances were returned.")
      End If
    End If

    Open in new window

    LVL 74

    Assisted Solution

    by:Glen Knight
    There is no nativr way to do this with Exchange 2003 there may be 3rd party tools but none that are built in.

    You could also try WMI scripting, see here for an example:;leftCol
    LVL 22

    Expert Comment

    Hi Otyew

    The Script I have posted and the links are the same what "Demazter" has posted ; probably we both were writing at the same time, so don't get confused its the same script.

    Hope this Helps

    Do read the article in full (link provided in my post) so it will give you a good insight.

    LVL 74

    Expert Comment

    by:Glen Knight
    You could also have a look at this:

    Author Comment

    thanks guys but i am not allowed to use a 3rd party tools. btw, do i save the codes as .vbs and then run it in dos?

    C:\> cscript codevbs
    LVL 74

    Expert Comment

    by:Glen Knight
    Yes its just a vbs script.

    Author Comment

    not really complete as there are no mailbox size of the users there. thanks btw...
    LVL 74

    Expert Comment

    by:Glen Knight
    You need to run it on the exchange server.

    Unfortunately if 3rd party is out of the question then a Script based on WMI is going to be the only option.

    Author Comment

    it there possible to add another column for the users mailbox size?

    Author Closing Comment


    Featured Post

    Are your corporate email signatures appalling?

    Is it scary how unprofessional your email signatures look? Do users create their own terrible designs and give themselves stupid job titles? You can make this a lot easier for yourself by choosing an email signature management solution from Exclaimer today.

    Join & Write a Comment

    Get an idea of what you should include in an email disclaimer with these Top 5 email disclaimer tips.
    Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
    In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now