Jan 22 2022 01:21 PM
i run the below against a CSV file and works fine on exchange online PS,
foreach($m in $mailboxes) {Get-MailboxStatistics $m.Identity.ToString() |select Identity, displayname, LastLogonTime, itemcount, totalitemsize; Start-Sleep -Milliseconds 500}
however when i add the Export-csv switch it only gets one user info exported, the last user in the list
i tried altering the line in many ways something is wrong while exporting the results only , the results are retrieved successfully on-screen when the command is fired without the Export parameter
foreach($m in $mailboxes) {Get-MailboxStatistics $m.Identity.ToString() |select Identity, displayname, LastLogonTime, itemcount, totalitemsize; Start-Sleep -Milliseconds 500 -Export-csv d:\123.csv}
Jan 22 2022 01:47 PM
Jan 23 2022 09:15 AM
Jan 23 2022 10:00 AM
SolutionJan 23 2022 10:02 AM