$Mailboxes = Get-Mailbox -RecipientTypeDetail UserMailbox -ResultSize Unlimited $Data = @() foreach($Mailbox in $Mailboxes){ $temp = Get-Mailbox $Mailbox.PrimarySmtpAddress.Address | Select-Object AddressBookPolicy, ProhibitSendQuota, SamAccountName, UserPrincipalName, WhenMailboxCreated, Alias, OrganizationalUnit, CustomAttribute1, DisplayName, PrimarySmtpAddress, RecipientType, RecipientTypeDetails, WindowsEmailAddress, WhenChanged, WhenCreated,StorageLimitStatus, TotalItemSize $temp.StorageLimitStatus = (Get-MailboxStatistics $Mailbox.PrimarySmtpAddress.Address).StorageLimitStatus $temp.TotalItemSize = (Get-MailboxStatistics $Mailbox.PrimarySmtpAddress.Address).TotalItemSize.Value $data+=$temp }$data