Forum Discussion
Converting GPOs to Powershell Commands for Storage Sense
We have existing policies that we'd like to replicate as Powershell commands since we are migrating to Azure AD (not premium and don't have Intune) so we'll lose the ability of applying these policies.
Has anyone setup these with Powershell (I am such a newbie with PS):
1. Enable Storage Sense
2. Set each OneDrive sync retention to 14 days.
It's currently setup in a policy so any existing or new OneDrive library they sync automatically gets set to 14 days.
We use ConnectWise Automate so we should be able to push these out to PCs with a script, if I can figure out how the powershell command looks.
2 Replies
- MikeCrowleyIron Contributor
Here are the registry locations for the storage sense policy settings. You can https://docs.microsoft.com/en-us/powershell/scripting/samples/working-with-registry-entries?view=powershell-7.1 like you would other registry settings.
- https://admx.help/?Category=Windows_10_2016&Policy=Microsoft.Policies.StorageSense::SS_AllowStorageSenseGlobal
- https://admx.help/?Category=Windows_10_2016&Policy=Microsoft.Policies.StorageSense::SS_AllowStorageSenseTemporaryFilesCleanup
- https://admx.help/?Category=Windows_10_2016&Policy=Microsoft.Policies.StorageSense::SS_ConfigStorageSenseGlobalCadence
- https://admx.help/?Category=Windows_10_2016&Policy=Microsoft.Policies.StorageSense::SS_ConfigStorageSenseCloudContentDehydrationThreshold
- https://admx.help/?Category=Windows_10_2016&Policy=Microsoft.Policies.StorageSense::SS_ConfigStorageSenseRecycleBinCleanupThreshold
- https://admx.help/?Category=Windows_10_2016&Policy=Microsoft.Policies.StorageSense::SS_ConfigStorageSenseDownloadsCleanupThreshold
Be aware, you can also https://www.anoopcnair.com/configure-storage-sense-in-intune-mem/. I'd do that instead of PowerShell if you're able to.
- luvsqlIron Contributor
MikeCrowley I seem to be missing the StorageSense folder from HKLM location for the dehydration settings we need. I don't have it in the HKCU either.