For non-persistent machines, whats your average de...
# microsoft-fslogix
s
For non-persistent machines, whats your average dehydration period for onedrive files? 1 day? 7 days?
j
I do 7 days
j
What method are you all using for rehydration for OneDrive? DEM Trigger? GPO Script? I've used this one in the past. Just wondering if you found better ways to accomplish it. ======================================================= .SYNOPSIS The script sets all files in OneDrive path to Cloud Only .DESCRIPTION Use this script to free space on user's FSLogix #> get-childitem $ENV:OneDriveCommercial -Force -File -Recurse -ErrorAction SilentlyContinue | Where-Object {$_.Attributes -match 'ReparsePoint' -or $_.Attributes -eq '525344' } | ForEach-Object { attrib.exe $_.fullname +U -P /s }
j
Copy code
I use this in a scheduled task at logon.
Copy code
$CutoffTime = (Get-Date).AddDays(-7)

get-childitem $env:OneDriveCommercial -Force -File -Recurse | where Attributes -eq 'Archive, ReparsePoint' | where LastAccessTime -le $CutOffTime | foreach {attrib.exe $_.fullname +U -P /s}
🙌 2
j
As low as possible 🙂
r
I use GPO for this. Haven't dug into if it actually works or not but when I see you guys using scripts for this I guess not.... 🫣
j
You need the script to actually mark the files as "offline" so that storage sense will actually remove them from the local cache.
r
Ah, so this is not sufficient?
👀 1
j
When it first came out in 2019 it wasnt working right for onedrive and we had to use scripts. Haven't tested really since then as the script just works.
r
Have to investigate it then! Maybe it's not doing anything...
j
Our VDI environment has Storage Sense disabled...