MEM – Managing Storage Sense
Update 02/06/2021: This post is still completely relevant today, however, I have created a new post that demonstrates configuring the below but using the settings catalog instead, see more here.
Welcome! Today’s post is about managing Windows 10 storage settings via Microsoft Endpoint Manager. Managing Storage Sense is not native to MEM, this post will detail how to manage these settings by deploying a custom OMA-URI profile and referencing the available settings in the Storage policy CSP.
What is Storage Sense?
Storage Sense is a little known feature introduced in Windows 10 1809 that is designed to keep storage optimised by removing unused files, such as temporary files, emptying the recycle bin, downloads and reverting OneDrive synced files to cloud-only status when not accessed over a period of time, storage sense can be triggered on-demand, by schedule or when low disk space is detected.
Objectives
As part of this post, I will demonstrate how to deploy the following Storage Sense settings:
- Turn on Storage Sense
- Configure Storage Sense to run on a weekly schedule
- Delete temporary files
- Delete files in recycle bin that has been present for over 30 days
- Delete files in my Downloads folder if present for over 90 days
- Revert OneDrive synced files to revert to cloud-only if not accessed in over 30 days
Prerequisites
- Administrative permissions within MEM Portal
- Test Windows 10 device enrolled into the MEM service and syncing with OneDrive Known Folder Move (KFM)
- Test account with a valid Intune license assigned
Creating the custom profile
Log into the MEM portal, browse to the devices view, select configuration profiles and then create profile:
Select Windows 10 and later as the platform and profile type of Custom and then Create:
Name the Configuration Profile and set a description so suit your needs and then select Next:
On the next page, this is where we’ll be adding in the OMA-URI’s, select Add for each of the following entries (Note: The below settings are to give examples, change the values to meet your requirements, I will list the available settings):
Turning on Storage Sense
The first OMA-URI to create is to simply turn on Storage Sense, it’s a straight forward on or off setting, available settings:
- 0 = Disable Storage Sense
- 1 = Enable Storage Sense (Default)
Setting | Value |
---|---|
Name | Turn Storage Sense On |
OMA-URI | ./Device/Vendor/MSFT/Policy/Config/Storage/AllowStorageSenseGlobal |
Data Type | Integer |
Value | 1 |
Configure Storage Sense to run on a weekly schedule
Available settings:
- 1 = Daily
- 7 = Weekly
- 30 = Monthly
- 0 = During low free disk space (Default)
Setting | Value |
---|---|
Name | Storage Sense Schedule |
OMA-URI | ./Device/Vendor/MSFT/Policy/Config/Storage/ConfigStorageSenseGlobalCadence |
Data Type | Integer |
Value | 7 |
Delete Temporary Files
Available settings:
- 0 = Disabled
- 1 = Enabled (Default)
Setting | Value |
---|---|
Name | Allow Storage Sense to delete temp files |
OMA-URI | ./Device/Vendor/MSFT/Policy/Config/Storage/AllowStorageSenseTemporaryFilesCleanup |
Data Type | Integer |
Value | 1 |
Delete files in recycle bin that has been present for over 30 days
Available settings:
- Range 0-365 (Default is 30)
Setting | Value |
---|---|
Name | Recycle Bin Cleanup Threshold |
OMA-URI | ./Device/Vendor/MSFT/Policy/Config/Storage/ConfigStorageSenseRecycleBinCleanupThreshold |
Data Type | Integer |
Value | 30 |
Delete files in my downloads folder if present for over 90 days
Available settings:
- Range 0-365 (Default is 0 for which the result is never)
Setting | Value |
---|---|
Name | Downloads Cleanup Threshold |
OMA-URI | ./Device/Vendor/MSFT/Policy/Config/Storage/ConfigStorageSenseDownloadsCleanupThreshold |
Data Type | Integer |
Value | 90 |
Revert OneDrive synced files to revert to cloud-only if not accessed in over 30 days
This setting will not only impact end users OneDrive synced account but also any synced SharePoint libraries, available settings:
- Range 0-365 (Default is 0 for which the result is never)
Setting | Value |
---|---|
Name | OneDrive Content Threshold |
OMA-URI | ./Device/Vendor/MSFT/Policy/Config/Storage/ConfigStorageSenseCloudContentDehydrationThreshold |
Data Type | Integer |
Value | 30 |
The profile should look something like this:
Verifying the results
Before
Before the settings are applied, open the Settings app, navigate to System, then Storage and observe the default settings:
After
On a test device that has the Storage Sense configuration profile assigned, open the Settings app, navigate to System, then Storage and observe the configured settings: