none
Export Mailbox stats RRS feed

  • Question

  • Hi Experts

    I have a csv file with mailboxes list.
    for example:

    Name
    user1@mydomain.com
    user2@mydomain.com
    user3@mydomain.com

    I want to export the below information

    Current mailbox usage
    IssueWarningQuota   
    ProhibitSendQuota   
    ProhibitSendReceiveQuota

    If archiving is enabled i want to pull the below info
    Archive Usage
    Archive Quota
    Archive issue warning

    Please help me to achieve this

    Tuesday, December 18, 2018 5:29 AM

Answers

  • Hi,

    You can use the following command:

    Import-csv C:\Users\administrator.CONTOSO\Desktop\users.csv | foreach {get-mailbox -identity $_.Name | select name,@{label="MailboxUsage";expression={(Get-MailboxStatistics $_.Name).TotalItemSize}},IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota,ArchiveState,@{label="ArchiveUsage";expression={(Get-MailboxStatistics -archive $_.Name).TotalItemSize}},archivequota,archivewarningquota}| export-csv <csv file location> -append -Notype -Encoding UTF8

    Here is my test result:
    1.  The following image shows my mailbox list:

    2.  Run the command:

    3.  Output:

    If a mailbox don’t have an archive mailbox, ArchiveUsage list shows empty.

    Regards,

    Lydia Zhou


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Wednesday, December 19, 2018 9:03 AM
    Moderator

All replies

  • Get-MailBox –Database “Mailbox Database 1034183002” | Format-List –Property DisplayName, MaxReceiveSize, MaxSendSize, ProhibitSendQuota, ProhibitSendReceiveQuota, storagelimitstatus | Export-CSV c:\test.csv

    Get-mailbox |Get-MailboxStatistics| select DisplayName,Database,TotalItemSize,ItemCount,storagelimitstatus,IssueWarningQuota,ProhibitSendQuota | export-csv C:\mailboxsizes.csv

    for archieve

    Get-Mailbox | where {$_.ArchiveDatabase -ne $null} | select name, archivedatabase, archivename, archivequota, archivewarningquota | Export-CSV c:\test.csv

    To get a list of all users with archive mailboxes you can run this command from the Exchange Management Shell:

    Get-Mailbox | where {$_.ArchiveDatabase -ne $null} | ft name, archivedatabase, archivename, archivequota, archivewarningquota -AutoSize  | Export-CSV c:\test.csv

    Best Regards,

    Rafiul

    Mark if this post is helpful.

    Tuesday, December 18, 2018 7:38 AM
  • I am using exchange server 2016
    i want to get the information by importing the csv not for all users



    • Edited by Risingflight Tuesday, December 18, 2018 10:17 AM 3
    Tuesday, December 18, 2018 10:17 AM
  • Hi experts from the below syntax i am getting output, but for all the users,
    i have a csv file and i want to import that csv and get output for those mailboxes.
    for example i have a csv file by name mymailboxes on c drive.(C:\mymailboxes.csv) in that csv file i have my users.

    Name
    user1@mydomain.com
    user2@mydomain.com


    Foreach($users in Get-Mailbox -ResultSize Unlimited){$users | Foreach-Object {    
    $user = $_   
    $stats = Get-MailboxStatistics $user.Name
    $archiveStats = Get-MailboxStatistics $User.name -Archive        
    New-Object -TypeName PSObject -Property @{        
    DisplayName = $User.DisplayName
    IssueWarningQuota = $User.IssueWarningQuota        
    ProhibitSendQuota = $User.ProhibitSendQuota        
    ProhibitSendReceiveQuota = $User.ProhibitSendReceiveQuota
    MailboxUsage = $stats.TotalItemSize
    ArchiveQuota = $User.ArchiveQuota
    ArchiveWarningQuota = $User.ArchiveWarningQuota
    ArciveUsage = $archiveStats.TotalItemSize
    RetentionPolicy = $User.RetentionPolicy                  

    } |Export-CSV C:\output.csv -NoTypeInformation -Append 
    }

    Tuesday, December 18, 2018 10:44 AM
  • Hi,

    You can use the following command:

    Import-csv C:\Users\administrator.CONTOSO\Desktop\users.csv | foreach {get-mailbox -identity $_.Name | select name,@{label="MailboxUsage";expression={(Get-MailboxStatistics $_.Name).TotalItemSize}},IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota,ArchiveState,@{label="ArchiveUsage";expression={(Get-MailboxStatistics -archive $_.Name).TotalItemSize}},archivequota,archivewarningquota}| export-csv <csv file location> -append -Notype -Encoding UTF8

    Here is my test result:
    1.  The following image shows my mailbox list:

    2.  Run the command:

    3.  Output:

    If a mailbox don’t have an archive mailbox, ArchiveUsage list shows empty.

    Regards,

    Lydia Zhou


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Wednesday, December 19, 2018 9:03 AM
    Moderator
  • Just checking in to see if above information was helpful.

    If you have any questions or need further help on this issue, please feel free to post back. If the issue has been resolved, please mark the helpful replies as answers, this will make answer searching in the forum easier and be beneficial to other community members as well.

    Regards, 

    Lydia Zhou


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to shareexplore and talk to experts about Microsoft Teams.

    Thursday, December 20, 2018 1:23 PM
    Moderator