Proactive Remediation scripts: create a report of OneDrive size and size on disk on your devices

1 A+ A-

In this post I will show you how to use Endpoint Analytics Proactive Remediation to make a report of Onedrive usage of users with size and size on disk.


See below what do we want:

- Get full size of user onedrive

- Get size on disk of onedrive files

- Make a report with those values

Get the script

Click on the below GitHub picture to get the script used to know size and size on disk.

In the download folder there aee 2 scripts:

- OneDrive_SizeOnDisk_Detection: detection script

- OneDrive_SizeOnDisk_Graph_ConvertTo_CSV: convert to Excel

See here my previous post about this method.

How it works ?

- Download the PS1

- Create a Proactive Remediation script

We will just use the detection part as we just want a report.

Create the remediation package

1. Go to the Microsoft Endpoint manager admin center

2. Go to Reports

3. Go to Endpoint analytics

4. Go to Proactive remediations

5. Click on Create script package

6. Type a name in our case OneDrive_GetSizeOnDisk

7. Click on Next

8. Click on Detection script file

9. Choose: Intune_OneDrive_GetSizeOnDisk.ps1

10. Click on Next

11. Select the group 

12. In the Schedule part, choose when the package should be run.

13. In our case we will run it every 3 hours (for our test)

14. Click on Apply

15. Click on Next

16. Click on Create

Get the result

1. Go to your remediation script

2. Go to device status

3. Go to column

4. Check Pre-remediation detection output

5. The information will be enabled as below:

6. When you click on Review you get details:

Convert to Excel report

So far we have a report on the Endpoint Manager Portal.

Now we will convert this report to a CSV.

For that see my below posts:

- Convert Proactive Remediation to CSV

- Use Azure Automation to convert Proactive Remediation to CSV 

See below how looks like the Excel report:

Proactive_Remediations 7922383135398564640

Enregistrer un commentaire

1 commentaire

Anonyme a dit…

Thank you for this post
Especially the export output to excel part

Accueil item


Learn KQL in one month


You want to support me ?

Mes articles en français

Books in French