Workaround for User Profile Disks (UPD)

When using Google Chrome or Microsoft Edge in conjunction with User Profile Disks (UPD) in remote desktop environments / terminal server enviornments, the error message COULD_NOT_GET_TEMP_DIRECTORY may occur, especially when installing extensions, such as heylogin.
The bug is listed under Chromium under the number 40384322.

Problem: COULD_NOT_GET_TEMP_DIRECTORY

Image without caption
This problem arises when the AppData folder is integrated into the UPD, which leads to path finding problems with Chrome. One solution would be to remove AppData from the UPD configuration, but this makes the synchronization of user-specific program files more difficult.
An alternative solution, without removing the AppData folder, is to set an alternative path for Chrome's temporary files. This can be implemented efficiently for all users via a group policy. Here is a simplified guide to it.

Workaround

This workaround is specifically listed here for Chrome, but also works with other Chrome-based browsers like Edge.
In this example, a local folder named TEMP on drive C: is used. If this does not yet exist, it must first be created. Afterwards, the following steps must be carried out:
  1. Create a new Group Policy
  1. In this policy, call up the following path on User ConfigurationSettingsWindows SettingsFolders
  1. Create a new entry and enter the following path: C:\\TEMP\\%USERNAME%
  1. Set the check mark at Common Options for Execute in the security context of the logged-on user
  1. Then switch from the Folders menu item to Environments
  1. There, create an entry TEMP and another one named TMP that each refer to the path C:\\TEMP\\%USERNAME%
  1. Again, the option Execute in the security context of the logged-on user must be activated for both entries
  1. Finally, ensure that the policy is also applied
After a user logs in next time, Windows should automatically create a corresponding subfolder in C:\TEMP. Google Chrome then uses these environment variables for its temporary data. Because the variables for TEMP and TMP have been adjusted, the files are redirected to the new folder. Consequently, the error COULD_NOT_GET_TEMP_DIRECTORY should no longer appear.