Product Version: 6.8.x+
Problem:
ProfileDisk grows excessively in size due to accumulation of temporary files in %temp%
Description:
By default, %TEMP% and %TMP% may reside within the user profile, causing temporary files to be written into the ProfileDisk. After logoff, these files provide no long-term value and can accumulate rapidly.
Resolution:
Redirect %TEMP% and %TMP% to a local machine disk. Since non-persistent desktops are refreshed or discarded, temporary data stored locally is automatically removed.
To address this issue create the following rules:
Note: All rules are available for import at the bottom of the article.
Application Launcher Rule 1) Creates ProfileDisk_Temp directory
- Filespec: %systemroot%\system32\cmd.exe
- Arguments: /c if not exist "%systemdrive%\ProfileDisk_Temp\%username%\ProU_PD_Excludes\AppData\Roaming\Microsoft\Teams\Service worker" mkdir "%systemdrive%\ProfileDisk_Temp\%username%\ProU_PD_Excludes\AppData\Roaming\Microsoft\Teams\Service worker"
- Timing: During Configuration Execution
- Hide Progress: True
- Run Async: False
- Execute without Elevation: False
Application Launcher Rule 2) Sets the correct permissions on "ProfileDisk_Temp" directory
- Filespec: %systemroot%\system32\cmd.exe
- Arguments: /c icacls.exe "%systemdrive%\ProfileDisk_Temp\%username%" /grant "%username%":(OI)(CI)F /inheritance:r & icacls.exe "%systemdrive%\ProfileDisk_Temp\%username%" /grant "system":(OI)(CI)F /inheritance:r & icacls.exe "%systemdrive%\ProfileDisk_Temp\%username%" /grant "administrators":(OI)(CI)F /inheritance:r
- Timing: During Configuration Execution
- Hide Progress: True
- Run Async: False
- Execute without Elevation: False
Application Launcher Rule 3) Pre-create teams path in appdata roaming
- Filespec: %systemroot%\system32\cmd.exe
- Arguments: /c if not exist "%appdata%\Microsoft\Teams" mkdir "%appdata%\Microsoft\Teams"
- Timing: During Configuration Execution
- Hide Progress: True
- Run Async: False
- Execute without Elevation: False
Application Launcher Rule 4) Move Microsoft Teams temp files off ProfileDisk to avoid ProfileDisk growth
- Filespec: %systemroot%\system32\cmd.exe
- Arguments: /c mklink /D "%appdata%\Microsoft\Teams\Service Worker" "%systemdrive%\ProfileDisk_Temp\%username%\ProU_PD_Excludes\AppData\Roaming\Microsoft\Teams\Service worker"
- Timing: During Configuration Execution
- Hide Progress: True
- Run Async: False
- Execute without Elevation: False
Application Launcher Rule 5) Hides the "ProfileDisk_Temp" directory from user
- Filespec: %systemroot%\system32\cmd.exe
- Arguments: /c attrib +H "%systemdrive%\ProfileDisk_Temp"
- Timing: During Configuration Execution
- Hide Progress: True
- Run Async: False
- Execute without Elevation: False
Environment Variables Rule 1)
- Variable Type: User
- Environment Variable: TMP
- Value: %systemdrive%\ProfileDisk_Temp\%username%
Environment Variables Rule 2)
- Variable Type: User
- Environment Variable: TEMP
- Value: %systemdrive%\ProfileDisk_Temp\%username%
Note: All rules are available for import at the bottom of the article.
Download the linked json file. In the ProfileUnity Management Console navigate to
Configuration Management > Edit Configuration.
Once in the configuration Click on the lighting icon and select Import.
Select the downloaded json. Once imported, update\deploy the configuration.