Disk size usage dashboard: understand what’s taking up space and remediate disk size issues on Intune devices
In this post I will show you a dashboard allowing you to easily monitor disk size on your devices and understand what takes place to resolve it.
What it does ?
Low disk space remains one of the most common root causes of performance degradation, update failures, and user incidents on managed Windows devices.
This post presents a Log Analytics Workbook designed to:
- Monitor disk space usage on Windows devices
- Monitor bad usage on devices
- Identify devices with low free disk space
- Analyze what content is consuming disk space (system vs user)
- Remediate disk space on a specific device
The dashboard allows you to easily analyze disk size on your Intune devices and see what's taking up place.
You can easily list devices with low disk space and identify what can be deleted without impact in order to free up space.
You can also analyze a specific device and easily see what you can remove on this one (without impact) to free up disk space.
Free up disk space
In the dashboard you will see, at different places, the following values:
- User content to purge
- System content to purge
- Size to clean
Those values allow you to see data that can be removed on devices to free up disk space (without impact for the user or system).
They are displayed in bytes meaning you can easily see quantity of data you can remove and if it can be useful to free up disk space.
For instance the chart below, shows count of devices (with low disk space) depending of volume of data that can be removed without impact.
You can see that there are:
- 332 devices with at least 5Gb that can be removed without impact
- 316 devices with at least 10Gb that can be removed without impact
- 132 devices with at least 30Gb that can be removed without impact
Other tabs show more details about that "Size to clean".
User content to purge
This part calculates data of the following folders:
- Downloads folder size
- user temp folder
- OneDrive size on disk
- Documents size on disk
- Desktop size on disk
- Recycle bin size
System content to purge
This part calculates data of the following folders:
- C:\ProgramData size
- C:\Windows\TempSize size
- C:\Windows\minidump
- C:\Windows\LiveKernelReports
- C:\Windows\memory.dmp
- Userprofile\AppData\Local\CrashDumps
- C:\WinsxsSize
- C:\Windows.old
- C:\Windows\ccmcache
- C:\Windows\SoftwareDistribution\Download
- C:\windows\Logs
Size to clean
This part calculates data of the following folders:
Size to clean = User content to purge + System content to purge
Monitoring disk size usage
The first tab, Resume, gives many insights about disk size usage.
The first step is to select the free space percentage.
The idea here is to select devices with less than a specific percentage of free disk space.
For that, use the free space parameter below:
It's by default configured to 10%.
It will automatically change data from the rest of charts available.
You will then get below data:
Free space on disk in %
Disk space available for cleanup
This part shows quantity of data that can be cleaned on devices with low disk space using the "Size to clean" value.
To get more info about the "Size to clean" value, check the part "Free up disk space" above.
Devices (by models) with low disk space
Monitoring bad usages
Purpose: this part allows you to see "bad usages" of your users with some numbers.
Downloads folder usage
It shows number of devices depending of size of the Downloads folder.
It allows you to see number of devices that have large Downloads folders.
Recycle bin usage
It shows number of devices depending of size of the Recycle bin.
OneDrive usage
This part shows multiple count of data about OneDrive usage.
To enable or disable this view, proceed as below:
1. Click on Edit
2. Go to the ShowOneDrivePart filter
3. Select True or False (True is default value)
You will then get below info:
- Number of devices that have the "Always keep on device" option checked at the root of OneDrive.
- Number of devices that have the Desktop folder oen OneDrive or locally.
- Number of devices that have the Desktop folder on OneDrive or locally.
- Number of devices that have the Documents folder on OneDrive or locally.
Devices with large PST and low disk space
This part shows devices that have PST mounted one devices with low disk space.
To enable or disable this view, proceed as below:
1. Click on Edit
2. Go to the ShowPSTPart filter
3. Select True or False (True is default value)
Monitoring device with low disk space
The second tab, Low disk space devices, gives many insights about devices with low disk space.
The first step is to select the free space percentage.
The idea here is to select devices with less than a specific percentage of free disk space.
For that use the free space parameter below:
It's by default configured to 10%.
It will automatically change data from the rest of the charts available.
This part allows you to see devices with low disk space and what's taking up space.
Through this part, you can see how you can easily free up disk space on those devices.
This tab is structured in 3 tabs:
- Global
- From system side
- From user side
Remediate disk size issue
Purpose: this part allows you to see what's taking up space on a specific device and how to free up space.
In this part you can see easily larger content on the target device, what can be removed and how to free up space.
The first step is to type a device name using the following filter:
You will get a lot of info about disk space usage on this device and what you can remove.
- Larger folders at C: root
- Larger folders in ProgramData
- Larger folders in C:\Users
- Larger folders at OneDrive root
- and more
Filters available
Multiple filters are available in the dashboard:
- Type a device name
- Filter by model
- Free space
- TimeRange
- ShowOneDrivePart
- ShowPSTpart
Sources to download
Click on the below GitHub picture to get following files:
- Workbook.json
- Detection.ps1
- Remediation.ps1
Log Analytics information
In order to create this report we will need some information relative to the Log Analytics workspace.
See below required info:
- Workspace ID
- Primary key
- Name of the custom log to create or update
To get those information go to Log Analytics Workspace > Agents management
You will find both Workspace ID and Primary key.
Then we will proceed as below:
1. Open the file Detection.ps1
2. Fill below variables:
- $CustomerID: workspace ID
- $ShareKey: Primary key
Creating the Remediation script
There are two files Detection.ps1 and Remediation.ps1
The Detection file will check devices with less than 20% of free disk space.
The Remediation script will be executed only for devices with less than 20% of free disk space.
1. Go to Devices
4. Go to Remediations
5. Click on Create script package
6. Type a name
7. Click on Next
8. Click on Detection script file
9. Browse the script Detection.ps1
10. Click on Remediation script file
11. Browse the script Remediation.ps1
12. Click on Next
13. Select the group
14. Choose how to schedule your script (in my case every 7 days)
15. Click on Apply
16. Click on Next
17. Click on Create
Adding the workbook
In this part we will add the report.
The report can be downloaded on GitHub, lin mentioned above.
The report is the file: Workbook.json
To add it, proceed as below:
1. Go to the Azure portal
2. Go to Log Analytics workspace
3. Go to Workbooks
4. Click on New
5. Go to Advanced editor, at the top
6. Remove content
7. Go to the GitHub link, there
8. Click on the copy button as below
9. Click on Apply
10. Click on Done editing then Save
Enregistrer un commentaire