Using Azure AD to authenticate to a VM - Works for one user and not another

Viewed 156

I'm new here, and also new to my azure devops role, so i'm learning. I'm hoping someone may be able to help me out with an issue I have, described below.... Please be patient with me if there is some info missing, it may take me a while to find it :-)

Overview

One user can connect/login to an Azure VM using aad, and the other one cant

Description

I have a VM created using Terraform (with associated pip, NSG and VNet etc.) from the "Windows Server 2019 Datacenter" image. It has a public IP Address. This VM has "AADLoginForWindows" extensions installed (It appears successfully!!) It is in the same aad as user1.surname@company.com, user2@company.com, user1's laptop & user2's laptop (Yes, the usernames are formatted differently) Both Laptops are greater then "Windows 10 1809". (In fact they are 1903 & 1909) Both laptops are "Hybrid Azure AD joined" to the aad The VM is "Azure AD joined" to the same aad Both user1 and user2 have been given "Virtual machine Administrator Login" role, as well as having contributor The NSG rules have been altered so that these peoples laptops can get through to the Windows VM.

First, I try to RDP to the VM as user1.surname@company.com...

I can run a "test Connection" from within AzPortal - That works I can connect to the VM using RDP from within AzPortal - That works I can login to the VM as user1.surname@company.com OR as AzureAD\user1.surname@company.com - that works for both ids

Second, I try to RDP to the VM as user2@company.com...

I can run a "test Connection" from within AzPortal - That works I can connect to the VM using RDP from within AzPortal - That works I cannot login to the VM as user2@company.com OR as AzureAD\user2@company.com - both ids fail They are coming up with the following error

Your credentials did not work.
The credentials that were used to connect to xx.xx.xx.xx did not work...

I have also tried this with a second user in the form user3.surname@company.com and that also has the same issues logging in to the VM.

Ant assistance/pointers would be greatly appreciated

1 Answers
Related