Hi
I am running the below PS command which extracts a list of user SMTP addresses from a text file and then query's the total mailbox size for each object and writes the output to a CSV file.
The problem I have is that when the output CSV file is written each object in the output is represented as a display name in the first column of the output file and totalmailbox size in the second column. I would like the first column in the output file to be the object's primary SMTP address and not the display name, can anyone help modify this command to achieve this.
Get-Content C:\roles.txt | Get-MailboxStatistics | Select DisplayName, @{expression={$_.Totalitemsize.Value.ToMB()}} | Export-Csv "C:\UserMailboxSizes.csv" -NoTypeInformation
Thanks