Intune Policy for automatically emptying downloads Folder

%3CLINGO-SUB%20id%3D%22lingo-sub-1260999%22%20slang%3D%22en-US%22%3EIntune%20Policy%20for%20automatically%20emptying%20downloads%20Folder%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1260999%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20i%20am%20new%20to%20Microsoft%20Intune.%20I%20am%20looking%20for%20way%20to%20automatically%20empty%20the%20download%20folder%20when%20a%20user%20logs%20out.%20I%20previously%20had%20a%20powershell%20script%20that%20had%20to%20be%20configured%20on%20every%20workstation%20in%20order%20to%20empty%20this%20downloads%20folder%20when%20a%20user%20logs%20out.%20Is%20there%20a%20way%26nbsp%3B%20to%20configure%20this%20in%20Microsoft%20Intune%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1260999%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EIntune%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMobile%20Device%20Management%20(MDM)%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1263082%22%20slang%3D%22en-US%22%3ERe%3A%20Intune%20Policy%20for%20automatically%20emptying%20downloads%20Folder%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1263082%22%20slang%3D%22en-US%22%3EI%20think%20it%E2%80%99s%20possible%20using%20Intune%20PowerShell.%20I%20have%20not%20used%20the%20script%20below%20but%20it%20may%20work%20for%20your%20situation.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EHope%20this%20helps!%3CBR%20%2F%3EMoe%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.lieben.nu%2Fliebensraum%2F2019%2F06%2Fsimplify-logon-scripts-in-intune-without-schedules%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.lieben.nu%2Fliebensraum%2F2019%2F06%2Fsimplify-logon-scripts-in-intune-without-schedules%2F%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgitlab.com%2FLieben%2FassortedFunctions%2Fblob%2Fmaster%2Finvoke-asIntuneLogonScript.ps1%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgitlab.com%2FLieben%2FassortedFunctions%2Fblob%2Fmaster%2Finvoke-asIntuneLogonScript.ps1%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1264426%22%20slang%3D%22en-US%22%3ERe%3A%20Intune%20Policy%20for%20automatically%20emptying%20downloads%20Folder%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1264426%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F598999%22%20target%3D%22_blank%22%3E%40koakenred%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20wouldn't%20create%20a%20specific%20Powershell%20script%2C%20but%20utilize%20a%20built-in%20feature%20from%20Windows%2010%2C%20called%20Storage%20Sense.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EStorage%20Sense%20can%20automatically%20cleanup%20certain%20unused%20files%20and%20also%20files%20in%20the%20Downloads.%3C%2FP%3E%3CP%3Echeck%20out%20this%20blog%20for%20more%20information%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.petervanderwoude.nl%2Fpost%2Fconfigure-storage-sense-via-windows-10-mdm%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.petervanderwoude.nl%2Fpost%2Fconfigure-storage-sense-via-windows-10-mdm%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20are%20looking%20for%20the%20'%3CSPAN%3EConfigStorageSenseDownloadsCleanupThreshold'%20setting.%20If%20you%20put%20that%20at%20'1'%2C%20all%20downloads%20are%20deleted%20after%20one%20day%20of%20not%20being%20opened.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
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?

2 Replies
Highlighted
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
Highlighted

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.