When connecting to systems using RDP with Azure AD, users often encounter the "Your credentials did not work" error. This issue stems from the PKU2U protocol, which is not enabled by default in Windows.
Disabling RDP NLA can resolve the issue but is not recommended due to security concerns.
Some requirements need to be met for RDP NLA to work with Azure AD. It is the recommended solution even if the process is more complex.
PKU2U needs to be enabled on both the RDP client and server. Use one of the methods below.
Open the Group Policy Editor (gpedit.msc).
Navigate to Computer Configuration – Windows Settings – Security Settings – Local Policies – Security Options.
Enable Network security: Allow PKU2U authentication requests to this computer to use online identities.
Reboot the server.
-
In PowerShell, run the following command:
$Pku2uRegPath = 'HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Pku2u' New-Item -Path $Pku2uRegPath -Force | Out-Null Set-ItemProperty -Path $Pku2uRegPath -Name 'AllowOnlineID' -Value '1' -Type DWORD
-
Reboot the server.
You need to either be logged into Windows with the same Azure AD account or be workplace joined with the same Azure AD user. Note that you can only be workplace joined with up to three users at the same time.
On your Windows machine, navigate to Settings – Accounts – Email & accounts.
Click on Add a work or school account.
Enter your Azure AD credentials, then click Sign in.
Wait for the Azure AD workplace join to complete.
In MSTSC: Use the format "AzureAD\user@domain.com".
In a RDP file: Use the format ".\AzureAD\user@domain.com" and leave the domain empty.
In Remote Desktop Manager: Enable the Azure AD host option in the RDP entry general properties.
Refer to the full article for more information: RDP NLA with Azure AD: The PKU2U Nightmare.