I’m trying to export a report in Office 365 of users online Archives. The export works but I want to be able to sort the data to make it easier to read. I’ve used the Sort-Object command vefore but now its not working and I get the data unsorted. Am I missing something simple? This is the command I am using
Get-Mailbox -Resultsize unlimited -Filter {customattribute1 -eq “staff”} | Get-MailboxStatistics -archive -erroraction silentlycontinue | select DisplayName,TotalItemSize | Sort-object “TotalItemSize (MB)” -Descending | Export-CSV “C:user dataArchive.csv”