Intune Policy for automatically emptying downloads Folder

Occasional Visitor

Hi i am new to Microsoft Intune. I am looking for way to automatically empty the download folder when a user logs out. I previously had a powershell script that had to be configured on every workstation in order to empty this downloads folder when a user logs out. Is there a way  to configure this in Microsoft Intune?

4 Replies
I think it’s possible using Intune PowerShell. I have not used the script below but it may work for your situation.


Hope this helps!
Moe

https://www.lieben.nu/liebensraum/2019/06/simplify-logon-scripts-in-intune-without-schedules/

https://gitlab.com/Lieben/assortedFunctions/blob/master/invoke-asIntuneLogonScript.ps1

Hi 

@koakenred 

 

I wouldn't create a specific Powershell script, but utilize a built-in feature from Windows 10, called Storage Sense.

 

Storage Sense can automatically cleanup certain unused files and also files in the Downloads.

check out this blog for more information:

https://www.petervanderwoude.nl/post/configure-storage-sense-via-windows-10-mdm/

 

You are looking for the 'ConfigStorageSenseDownloadsCleanupThreshold' setting. If you put that at '1', all downloads are deleted after one day of not being opened.

This is really helpful, however, can this be used for the exact use case i.e. clear downloads on each logout?
There is no built-in way to do this. You would have to create a scheduled task through Intune to do this