12Knocksinna / Office365itpros

Office 365 for IT Pros PowerShell examples
MIT License
1.28k stars 567 forks source link

Appending report entries opposed to writing all upon completion #26

Closed awdhaan closed 3 years ago

awdhaan commented 3 years ago

First of all! I love this script! it's awesome!

I've recently tried to perform an inventory of 8.000+ Groups & Teams. Just ~200 objects to scan before completion (running for almost 36 hours), my system crashed and I lost all data.

The issues is, that the scan generate the CSV-output after all scans have been completed, hence the loss of data during my scan. It would be better to append the data of each scanned object to a csv-file before moving to the next.

JH050 commented 3 years ago

@awdhaan I just found out the script works about 7x as fast when you run it as a Global Admin instead with a 'normal' Admin account (with Exchange-admin, SharePoint-admin, Teams-admin permissions). I'm not sure why it works this way, because I expected only the Graph API permissions would matter. Anyway, perhaps this could help you to speed up to process.

awdhaan commented 3 years ago

Thanks, I did run it with a Global Admin-role using v4.8 (non-Graph).

12Knocksinna commented 3 years ago

We're well aware of the problem dealing with long running scripts, which is why we moved to Graph calls in the latest version of the script. This version is 5.1. See https://office365itpros.com/2020/01/14/office-365-groups-teams-activity-report/