I am executing below script to export a detailed mailbox statistics report but it is not showing result for RecipientTypeDetails and LitigationHoldEnabled in output file. Instead it contains + Microsoft.Exchange.Management.MapiTasks.Presentation.MailboxStatistics.RecipientTypeDetails + in the output for these two fields. Can someone help.
$mbx = Get-Mailbox -ResultSize Unlimited
$head = "DisplayName,Alias,ItemCount,TotalItemSize,LastLoggedOnUserAccount,LastLogonTime,LastLogOffTime,RecipientTypeDetails,LitigationHoldEnabled"
$head | Out-File -Append MailboxReport.csv
$mbx | % {
Write-Host -Fore Green "Processing $mbx.Name"
$user = Get-MailboxStatistics -Identity $_.Identity
$data = """" + $user.DisplayName + """" + "," + """" + $user.Alias + """" + "," + """" + $user.ItemCount + """" + "," + """" + $user.TotalItemSize + """" + "," + """" + $user.LastLoggedOnUserAccount + """" + "," + """" + $user.LastLogonTime + """" + "," + """" + $user.LastLogOffTime + """"," + """" + $user.RecipientTypeDetails + """"," + """" + $user.LitigationHoldEnabled + """"
$data | Out-File -Append .\MailboxReport.csv
}