Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filtering users by companyName

I was trying to get all users in my Azure Active Directory filtered by companyName filtering.

The call I used was

/v1.0/users?$select=id,mail,displayName,department&$filter=companyName%20eq%myComapny

but it is returning an error BadRequest .

Am I doing something wrong here?

like image 542
Alias Varghese Avatar asked Nov 03 '17 08:11

Alias Varghese


1 Answers

As Dan said, for now filtering on companyname is not supported.

As a workaround, we can use Azure AD v2 powershell to filter it, like this:

Get-AzureADUser | ?{ $_.CompanyName -eq 'company' }

Hope this helps.

like image 63
Jason Ye Avatar answered Nov 17 '22 18:11

Jason Ye