Hi
I have personally not tried the scenaro you are trying to implement.
Do you have the MAC addresses in Entra ID? If so, is the MAC address format the same as the format of the string returned by %{Endpoint:Username}.
userPrincipalName is normally in the format like firstname.lastname@domain.com, and I'm thinking in your case maybe macaddress@domain.com. If so you may need to add the domain suffix to the query like the one below. I have also added the comparison eq to the query.
/users/?$select=mail,userPrincipalName,id,department,accountEnabled&$filter=userPrincipalName eq %{Endpoint:Username}@domain.com
Try with both just adding the eq to the query and also add a UPN suffix.
------------------------------
Best Regards
Jonas Hammarbäck
MVP Guru 2024, ACEX, ACDX #1600, ACCX #1335, ACX-Network Security, Aruba SME, ACMP, ACSA
Aranya AB
If you find my answer useful, consider giving kudos and/or mark as solution
------------------------------