Starting with Windows Server 2019 someone at Microsoft apparently thought it was a great idea to make the various application-windows borderless, making it really hard to see the windows. Below is an example of two File Explorer windows overlapping, the arrow pointing to the top border of the window in front.

The Fix via PowerShell – Current User
Fixing the issue is quite easy, simply add a registry key the restores the behavior back to how it was in Windows Server 2016. Here is a PowerShell snippet that does it for you:
$RegistryKey = "HKCU:Control Panel\Desktop"
$Name = "UserPreferencesMask"
$Value = ([byte[]](0x90,0x32,0x07,0x80,0x10,0x00,0x00,0x00))
$Type = "Binary"
New-ItemProperty -Path $RegistryKey -Name $Name -Value $Value -PropertyType $Type -Force
Note: You need to log out and login for the setting to take effect.

The Fix via PowerShell – Default User
If you rather change it for all users, for example during deployment, you can load the default user registry and set the value there. Here is an example:
# Load the offline registry hive from the OS volume
$HivePath = "C:\Users\Default\NTUSER.DAT"
New-PSDrive -PSProvider Registry -Root HKEY_USERS -Name HKU
reg load "HKU\Tmp" $HivePath
Start-Sleep -Seconds 5
# Updating default registry hive to show Windows Borders
$RegistryKey = "HKU:Tmp\Control Panel\Desktop"
$Name = "UserPreferencesMask"
$Value = ([byte[]](0x90,0x32,0x07,0x80,0x10,0x00,0x00,0x00))
$Type = "Binary"
New-ItemProperty -Path $RegistryKey -Name $Name -Value $Value -PropertyType $Type -Force
# Cleanup (to prevent access denied issue unloading the registry hive)
Get-Variable Registry* | Remove-Variable
[gc]::collect()
Start-Sleep -Seconds 5
# Unload the registry hive
reg unload "HKU\Tmp"
The Fix via Group Policy Preference
If using legacy Active Directory, you can also create a Group Policy Preference that sets the value. Create a new Group Policy and navigate to User Configuration / references / Windows Settings / Registry. Then add a Registry Item with the following settings:
- Action: Update
- Hive: HKEY_CURRENT_USER
- Key Path: Control Panel\Desktop
- Value name: UserPreferencesMask
- Value type: REG_BINARY
- Value data: 9032078010000000

I used the Group Policy Preference method and it works great. As soon as users logged out and back in again, this was set. This was especially handy since we have multiple Remote Desktop servers and it only had to be set once. Much appreciated Johan.
Hello Johan, I did some tests, I found that the active setup "Windows Desktop Update" changes the values of UserPreferencesMask which is in the default user on the new user, if i delete the active setup "Windows Desktop Update" the parameter that is in the default user is indeed applied to the new user, but I don't know the impact that deleting this key can have!
Hello Johan, I tested your procedure by adding the registry key in the default user on Win2019 and Win2022, but nothing is applied to new users, should something else be changed?
What else does the mask set?
UserPreferencesMask has a bunch of bit flags that can be combined (see below). Here is a tool that can help you combine them: https://www.silisoftware.com/tools/tweakui.php ActiveWindowTracking = 0x1 MenuAnimation = 0x2 ComboBoxAnimation = 0x4 ListBoxSmoothScrolling = 0x8 GradientCaptions = 0x10 KeybordCues = 0x20 ActiveWindowTrackingZOrder = 0x40 HotTracking = 0x80 Reserved8 = 0x100 MenuFade = 0x200 SelectionFade = 0x400 ToolTipAnimation = 0x800 ToolTipFade = 0x1000 CursorShadow = 0x2000 Reserved14 = 0x4000 Reserved15 = 0x8000 Reserved16 = 0x10000 Reserved17 = 0x20000 Reserved18 = 0x40000 Reserved19 = 0x80000 Reserved20 = 0x100000 Reserved21 = 0x200000 Reserved22 = 0x400000 Reserved23 = 0x800000 Reserved24 = 0x1000000 Reserved25… Read more »
Thanks Johan, excellent like always.