Hello @GennartTony-0062,
Azure Bastion Host connects the VM with the minimum features.The Font Smoothing/ClearType Text gets enabled/disabled based upon client request - in this case Azure Bastion - is initiating the remote session to without Font Smoothing. That is reason why we see the ClearType Text gets disabled on connecting to the Azure VM.
Hardcoding the registry keys at machine level and user level will not unfortunately help. Every time, the session is initiated, the remote machine's setting is overridden by the remoting client.
As far as I have researched, at this point of time we currently don't have a option to configure the Bastion Host to initiate the Remote session with FontSmoothing.
Upon further researching and testing, I was able to find a temporary workaround :
Step 1 :
Create a Powershell script that enables the Clear Type Text .
Created PS1 file with the below script.
$signature = @'
[DllImport("user32.dll")]
public static extern bool SystemParametersInfo(
uint uiAction,
uint uiParam,
uint pvParam,
uint fWinIni);
'@
$SPI_SETFONTSMOOTHING = 0x004B
$SPI_SETFONTSMOOTHINGTYPE = 0x200B
$SPIF_UPDATEINIFILE = 0x1
$SPIF_SENDCHANGE = 0x2
$FE_FONTSMOOTHINGCLEARTYPE = 0x2
$winapi = Add-Type -MemberDefinition $signature -Name WinAPI -PassThru
[void]$winapi::SystemParametersInfo($SPI_SETFONTSMOOTHING, 1, 0, $SPIF_UPDATEINIFILE -bor $SPIF_SENDCHANGE)
[void]$winapi::SystemParametersInfo($SPI_SETFONTSMOOTHINGTYPE, 0, $FE_FONTSMOOTHINGCLEARTYPE, $SPIF_UPDATEINIFILE -bor $SPIF_SENDCHANGE)
Step 2 :
Create a task with the trigger - On Connection to user session and action to execute the above script using Powershell.
Output :
The script ran and enabled the ClearType Text on connecting through the Azure Bastion (or any remoting client)
The script runtime was very less- you will see a window for a second.
The text became clearer.
Additional Suggestion
In case you would not prefer manually doing the above steps for multiple Lab VMs. You could create custom image from the VM implemented with above steps, create VMs of this custom image.