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