Windows 11 RDP credential saving

Recently I ran into a problem where I tried using a saved RDP file to initiate a connection and I was greeted with an error message that read “Windows Defender Credential Guard does not allow using saved credentials”. The workaround for this requires you to open a command prompt and enter this command:
cmdkey /generic:TERMSRV/<targetname> /user:<username> /pass:<password>
Replace the parts in brackets with the appropriate data and hit enter. Now you can use these saved credentials when you want to use RDP.