Filtering users by companyName

Viewed 3010

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?

3 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.

Filtering on companyName is not supported. Can you indicate the scenario for why you need to filter on companyName, please?

As per the recent update from microsoft docs here

We can filter on CompanyName and possibly others too by passing additional header information.

We need to pass :

Header ConsistencyLevel = eventual

enter image description here

Related