Skip to content

Get-AzADUser -Mail option does not work, is there another way to do it. Same issue by using AAD client directly when filter set to mail #11981

@DhivyaG19

Description

@DhivyaG19

From additional debugging, filter applied is UPN, should be mail.

I tried using AAD client directly by setting filter in it to mail, still same issue.

Also, type is always null, I thought it will be guest

Get-AzADUser -Mail "mireks.pm@xxxxxx.com" -Debug
DEBUG: 4:46:20 PM - GetAzureADUserCommand begin processing with ParameterSet 'MailParameterSet'.

HTTP Method:
GET
Absolute Uri:
https://graph.windows.net/dbef1e29-488c-4b64-90ac-287b977faaa3/users?$filter=userPrincipalName eq
'mireks.pm@xxxxxxx.com'&api-version=1.6

Body:
{
  "odata.metadata": "https://graph.windows.net/dbef1e29-488c-4b64-90ac-287b977faaa3/$metadata#directoryObjects",
  "value": []
}

When I give my full UPN it works.

Get-AzADUser -Mail "mireks.pm_xxxxxx.com#EXT#@xxxxxxx.onmicrosoft.com"
UserPrincipalName : mireks.pm_xxxxxxx.com#EXT#@xxxxx.onmicrosoft.com
ObjectType        : User
DisplayName       : mireks xxxxx
Id                : 40146d24-4b42-498c-b4c1-d6a1c223d21e
Type              :

Metadata

Metadata

Assignees

Labels

AADAzAd cmdlets in Az.ResourcesAzure PS TeambugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reported

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions