Forum Discussion
hdsouza1
Nov 05, 2026Copper Contributor
Get-MgReportMailboxUsageDetail fails with : Cannot access a closed Stream
Since Nov 3 at 10 PM EST Get-MgReportMailboxUsageDetail fails with "Cannot access a closed Stream" The command used is : Get-MgReportMailboxUsageDetail -Period D7 -OutFile C:\Temp\test.csv Has anyo...
- Nov 05, 2026
Works fine here, perhaps some temporary issue?
You can always get the data as JSON instead, and use Export-CSV against it:
$a = Invoke-MgGraphRequest -Uri "https://graph.microsoft.com/beta/reports/microsoft.graph.getMailboxUsageDetail(period='D7')?`$format=application/json" -OutputType PSObject $a.value | Export-Csv D:\Downloads\temp.csv
VasilMichev
Nov 05, 2026MVP
Works fine here, perhaps some temporary issue?
You can always get the data as JSON instead, and use Export-CSV against it:
$a = Invoke-MgGraphRequest -Uri "https://graph.microsoft.com/beta/reports/microsoft.graph.getMailboxUsageDetail(period='D7')?`$format=application/json" -OutputType PSObject
$a.value | Export-Csv D:\Downloads\temp.csv