$mbxStats | Export-Csv -Encoding ‘Unicode’ c:\powershell\MailboxSizes.csv # Add right hand operand to value of variable ($mbx) and place result in variable ($mbxStats) $mbx | Add-Member -MemberType NoteProperty -Value $() -Name TotalSizeMB
$mbx | Add-Member -MemberType NoteProperty -value $mail.ProhibitSendReceiveQuota -Name ProhibitSendReceiveQuota $mbx | Add-Member -MemberType NoteProperty -value $mail.prohibitsendquota -Name ProhibitSendQuota $mbx | Add-Member -MemberType NoteProperty -value $mail.issuewarningquota -Name WarningQuota $mbx | Add-Member -MemberType NoteProperty -Value $mail.database -Name Database $mbx | Add-Member -MemberType NoteProperty -Value $mail.OrganizationalUnit -Name OrganizationalUnit
$mbx | Add-Member -MemberType NoteProperty -Value $stats.Displayname -Name DisplayName # Add user-defined customs members: the records retrieved with the three PowerShell commands # Retrieve the identity and store it in the variable $_ Get-Mailbox -ResultSize Unlimited | Where When you say filter, does that mean that you only want to run the command for one department? If so, run the following command and add your department name: | Export-Csv “UserMailboxSizes.csv” –NoTypeInformationĪnd the complete command again with all parts combined together: Then we add another attribute that Get-Mailbox gives us:Īnd to finish it off we export the results to a CSV file after another pipe: We continue with adding two that performs Get-MailboxStatistics to receive attributes from the mailbox that the Get-Mailbox Cmdlet does not give $_).()}} and $_).ItemCount}} Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName, IssueWarningQuota, ProhibitSendQuota Then we add a pipe and a number of attributes we want to get: This should work for both Exchange Server 20, here is how we did it: I got a question form a friend if I could help and sort out a command that exported mailbox size and quotas to a CSV file for him.