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

4 Spice ups

try

Import-Csv c:\list.csv |Foreach{get-mailbox $_.name |select Name,IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota
}

Import-Csv c:\list.csv |Foreach{get-mailbox $_.name | where {$_.ArchiveDatabase -ne $null} | select name, archivedatabase, archivename, archivequota, archivewarningquota}

i also want know to know the current usage of primary mailbox, and if archiving is enabled , current usage of archive mailbox

We can use Get-User , Get-Mailbox and Get-MailboxStatistics to list the user and mailbox status.

Try this:

Get-Mailbox -Resultsize Unlimited | Get-MailboxStatistics | where {($.StorageLimitStatus -contains “ProhibitSend”) –or ($.StorageLimitStatus -contains “IssueWarning”)}

If you only need archive mailbox information, you could try this:

Get-Mailbox | where {$_.ArchiveDatabase -ne $null} |
select name, archivedatabase, archivequota, archivewarningquota,
@{label="TotalItemSize(MB)";expression={(Get-MailboxStatistics $_).TotalItemSize.Value.ToMB()}} |
export-csv c:\archiveuser.csv -append -Notype -Encoding UTF8

What’s your Exchange version?

For on-premise, you could run the cmdlet below through EMS to achieve current usage of primary/archive mailbox.

Get-MailboxDatabase | Get-MailboxStatistics | Sort TotalItemSize -desc | select DisplayName

,TotalItemSize, Database*quota | export-csv c:\mailboxes.csv

For Exchange Online, you can run and export a quick mailbox usage report from the Office 365 admin center - Under Reports / Usage - at the top, select a report to drop down / Exchange / Mailbox usage.

see the second script

Exchange server 2016 Version 15.1, but i want to get the information by importing the csv not for all users

Just check my script

@jwieger