Forum Discussion
OneDrive with FSlogix in an AVD environment how to prevent profile bloat
You can try to create a scheduled Task with the Command "c:\windows\System32\cleanmgr.exe /autoclean /d C:" on User Logon with a delay of 5 or 10 Minutes.
This will trigger a cleanup for the User.
When you use the Powershell Script for configure Storage Sense with OneDrive, this command also cleanup OneDrive Files.
- steveturnbull1975Mar 28, 2023Brass Contributor
Travis_78 so I’ve put together a solution that runs a scheduled task at user logon but delays it by 30 minutes so it doesn’t overload the logon process. The task goes through a users onedrive folder and “removes” locally cached files in the container which haven’t been modified for more than 30 days and sets them back to online only.
then fslogix shrinks the container at logoff.
there is some issues with onedrive (bugs) since testing however. If someone tries to download a large file to onedrive and it breaks during the process, onedrive will show the cloud icon but the partial download actually ends up in the profile container. I have no idea how to fix this. The only way this will be fixed is with the user re-attempting the same download to completion which would then flag the file with a green circle. This appears to be a major design flaw in onedrive.
the other issues I’ve come across is if the files are a cloud icon and if you attempt to copy the same files over the top from a file share and select the replace option the files remain a cloud icon but the files actually end up in the container (maybe more of an edge case)
I have serious concerns around the level of testing on this onedrive product as it seems to be pretty inconsistent sometimes in its operations.
ill be implementing the script soon to do the clean up so will see how much of a difference I see on the storage. However as mentioned there are scenarios where it’s not going to work optimally due to what appear to be bugs with onedrive