Problem:
Alternative storage for OneNote when using ProfileDisk
Reason to use this method is when OneNote is taking up too much space within the ProfileDisk and causing unnecessary bloat of the dynamic vhdx. This method will use local temp scratch storage instead.
Resolution:
Within the configuration in ProfileUnity, four Application Launcher module rules will be created. These rules can be create as shown below or imported with the json attached to the kb. (ModuleItems-Windows 10, 11, 2016, 2019 or 2022 as a Desktop Multi-Session ProfileDisk - (1).json). The json will be imported in the Application Launcher module within the config
1) First new Application launcher rule
Filter: Any
Description: Create Onenote in profile disk temp
Filespec: %systemroot%\system32\cmd.exe
Arguments: /c if not exist "%systemdrive%\ProfileDisk_Temp\%username%\ProU_PD_Excludes\AppData\Local\Microsoft\OneNote\16.0\cache" mkdir "%systemdrive%\ProfileDisk_Temp\%username%\ProU_PD_Excludes\AppData\Local\Microsoft\OneNote\16.0\cache"
Timing: During Configuration Execution
Frequency: Every Logon
2) Second new Application launcher rule
Filter: Any
Description: Cleans up previous OneNote cache local data
Filespec: %systemroot%\system32\cmd.exe
Arguments: /c if exist "%localappdata%\Microsoft\OneNote\16.0\cache" rmdir "%localappdata%\Microsoft\OneNote\16.0\cache"
Timing: During Configuration Execution
Frequency: Every Logon
3) Third new Application launcher rule
Filter: Any
Description: Pre-create MS OneNote path in appdata local
Filespec: %systemroot%\system32\cmd.exe
Arguments: /c if not exist "%localappdata%\Microsoft\OneNote\16.0" mkdir "%localappdata%\Microsoft\OneNote\16.0"
Timing: During Configuration Execution
Frequency: Every Logon
4) Fourth new Application launcher rule
Filter: Any
Description: Move Microsoft OneNote cache files off ProfileDisk to localdisk
Filespec: %systemroot%\system32\cmd.exe
Arguments: /c mklink /D "%localappdata%\Microsoft\OneNote\16.0\cache" "%systemdrive%\ProfileDisk_Temp\%username%\ProU_PD_Excludes\AppData\Local\Microsoft\OneNote\16.0\cache"
Timing: During Configuration Execution
Frequency: Every Logon
5) The order of the rules should be similar as shown as example within existing ProfileDisk template :
6) To verify it's working check the symlink is shown when going to the cache directory and if shown correctly the files within the folder exists.
7) Also, verify the files within the folder Appdata Local folder is the same with Profiledisk_Temp
Product: ProfileUnity
Product Version: 6.8.4+