OneDrive
By default, the Personal OneDrive folder is created in the root of the user profile: %USERPROFILE%\OneDrive
By default, the Personal OneDrive for business folder is created in the root of the user profile: %USERPROFILE%\OneDrive – <COMPANYNAME>
As previously mentioned, it is recommended that user data folders are redirected and therefore outside the User Profile container.
This creates a dilemma, as OneDrive by default will sync the user's documents to the cloud resulting in three copies of the data.
- In the user's redirected Documents Folder
- In the Cloud
- In the OneDrive Cache folder (in the profile container)
If redirecting Documents, to prevent profile bloat, then shouldn't the same principle be applied to the OneDrive Cache?
In all cases it is suggested that you Prevent users from syncing personal OneDrive accounts. This can be disabled using Group Policy.
User Configuration - Policies - Administrative Templates
OneDrive
Prevent users from syncing personal OneDrive accounts: Enabled
The non-business OneDrive icon in Explorer may be hidden with the following registry setting.
[HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}]
"System.IsPinnedToNameSpaceTree"=dword:00000000
Additionally ONLY allow synching of OneDrive for your specific organisation, using Group Policy.
Computer Configuration - Policies - Administrative Templates
OneDrive
Allow syncing OneDrive accounts for only specific organizations: Enabled
Specify tenant ID: In the Value field, enter the tenant ID you want to add to this list.
Five Options exist for your OneDrive deployment
- Don't Use OneDrive
- Use OneDrive in standard sync mode (will cause profile bloat)
- Use OneDrive in On-Demand Mode (will cause reduced profile bloat)
- Use OneDrive in On-Demand Mode (Non-Persistent)
- Map a Windows Drive to OneDrive (Online Mode)
Don't Use OneDrive
Uninstall OneDrive using teh following script
set x86="%SYSTEMROOT%\System32\OneDriveSetup.exe"
set x64="%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe"
echo Closing OneDrive process.
echo.
taskkill /f /im OneDrive.exe > NUL 2>&1
ping 127.0.0.1 -n 5 > NUL 2>&1
echo Uninstalling OneDrive.
echo.
if exist %x64% (
%x64% /uninstall
) else (
%x86% /uninstall
)
ping 127.0.0.1 -n 5 > NUL 2>&1
echo Removing OneDrive leftovers.
echo.
rd "%USERPROFILE%\OneDrive" /Q /S > NUL 2>&1
rd "C:\OneDriveTemp" /Q /S > NUL 2>&1
rd "%LOCALAPPDATA%\Microsoft\OneDrive" /Q /S > NUL 2>&1
rd "%PROGRAMDATA%\Microsoft OneDrive" /Q /S > NUL 2>&1
echo Removeing OneDrive from the Explorer Side Panel.
echo.
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1
REG DELETE "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f > NUL 2>&1
rem remove One Drive from Default User
reg load HKLM\DefUser C:\Users\Default\ntuser.dat
reg DELETE HKLM\DefUser\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v OneDriveSetup /f
reg unload HKLM\DefUser
rem remove One Drive from Current User
reg DELETE HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v OneDriveSetup /f |
You can also hide the entry points to OneDrive in Microsoft Office with the folowing Group Policy setting.
User Configuration - Policies - Administrative Templates
Microsoft Office 2016/Privacy/Trust Center
Allow the use of connected experiences in Office: Disabled
Before |
After |
|
|
Use OneDrive in On-Demand Mode
Save disk space with OneDrive Files On-Demand for Windows 10
With OneDrive Files On-Demand, you can:
- Save space on your device by making files online only
- Set files and folders to be always available locally on your device
- See important information about files, such as whether they are shared
- See thumbnails of over 300 different file types even if you don’t have the required application installed to open it
OneDrive Files On-Demand can be enabled using Group Policy.
Computer Configuration - Policies - Administrative Templates
OneDrive
Use OneDrive Files On-Demand: Enabled
Although not all files will be synched to %USERPROFILE%\OneDrive – <COMPANYNAME>, files that are created / editted will accumulate over time.
Use OneDrive in On-Demand Mode (Non-Persistent)
If retaining the On-Demand OneDrive Cache in the Profile Container is still causing too much profile bloat, you can redirect the OneDrive – FOR BUSINESS folder to an alternative location using Group Policy.
User Configuration - Policies - Administrative Templates
OneDrive
Specify the tenant ID and default path.
In the Value name field, enter the tenant ID. In the Value field, enter the path.
Path: 11111111-2222-3333-4444-55555555 %LocalAppData%
In this case, OneDrive for business has been redirected to the AppData\Local\OneDrive – <COMPANYNAME>.
If you are excluding Appdata\Local in redirections.xml, then the OneDrive cache will not be retained at logoff. This does mean that the cache has to be recreated at every logon which will require time and network I/O.
You may need to add the following excludes to your redirections.xml.
<Exclude Copy="0">OneDrive</Exclude>
<Exclude Copy="0">OneDrive – YOUR COMPANY</Exclude>
<Exclude Copy="0">AppData\Local\Microsoft\OneDrive</Exclude>
<Exclude Copy="0">AppData\Local\OneDrive</Exclude>
The Group Policy setting must be in place on the user’s first logon. This is because the location of the OneDrive folder is stored in the registry.
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\OneDrive\Accounts\Business1]
"UserFolder"="C:\\Users\\user1\\AppData\\Local\\OneDrive - <COMPANYNAME> "
However excluding the OneDrive cache will create an issue at the user's second logon, becasue the preconfigured cache no longer exists.
The error may be resolved by configuring a Group Policy Registry Preference.
Action: Delete
Hive: HKEY_CURRENT_USER
Key path SOFTWARE\Microsoft\OneDrive
This configuration will cause OneDrive to configure itself at every logon as if it has never been configured before. This may take an unreasonable amount of time to complete a full sync at every logon.
Map a Windows Drive to OneDrive (Online Mode)
It is possible to map a drive to OneDrive using Windows Explorer for direct online access.
An Open Source Powershell script, OneDriveMapper, is available at https://www.lieben.nu/liebensraum/onedrivemapper/
Or
Third Party products are available such as IAM Cloud CloudDriveMapper.
|