export mailbox information

Glenn Maxwell 10,731 Reputation points
2022-11-28T18:18:27.837+00:00

Hi All

I am using exchange 2016 hybrid environment. we create mailboxes in onprem and migrate to online. i want to export all my mailboxes size along with Recoverable items folder size and Litigation hold status. i want to try something like the below experts guide me. can i pull the data in GB

foreach($users in Get-Mailbox -ResultSize Unlimited){$users | Foreach-Object {      
$user = $_     
$stats = Get-MailboxStatistics $user.Name  
Get-MailboxFolderStatistics  $user.Name -FolderScope RecoverableItems | Where-Object {$_.FolderPath -eq "/Recoverable Items"}            
New-Object -TypeName PSObject -Property @{          
DisplayName = $User.DisplayName  
FirstName = $User.FirstName  
LastName = $User.LastName  
userprincipalname = $User.userprincipalname  
primarysmtpaddress = $User.primarysmtpaddress  
IssueWarningQuota = $User.IssueWarningQuota          
ProhibitSendQuota = $User.ProhibitSendQuota          
ProhibitSendReceiveQuota = $User.ProhibitSendReceiveQuota         
TotalItemSize = $stats.TotalItemSize      
LitigationHoldEnabled = $User.LitigationHoldEnabled  
RecoverableItems = $User.RecoverableItems           
}   
}  
}| export-csv "c:\temp\output.csv" -NotypeInformation  
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,358 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,481 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,985 questions
{count} votes

Accepted answer
  1. KyleXu-MSFT 26,236 Reputation points
    2022-11-29T02:14:48.21+00:00

    @Glenn Maxwell

    This blog will be useful to you: Get Exchange Online Mailbox Size in GB
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    264920-1.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments

0 additional answers

Sort by: Most helpful