Search for users by email domain

I’m writing code for a feature that allows us to change the email domain for all users given old and new domain names.
So I would need to search the directory for all users having the old email domain.
If I do a search like:
I get all users whose email starts with ‘test’
But if I search with endsWith:
I get this error:

  "errorCode": "E0000031",
  "errorSummary": "Invalid search criteria.",
  "errorLink": "E0000031",
  "errorId": "oaeBre_Q4s6SHWeKFK6WCo4Og",
  "errorCauses": [
      "errorSummary": "Invalid search syntax."

I expect that the directory will eventually be quite large, so I don’t want to pull all users.
How can I search users by email domain?


ew is only available for the System Log API

1 Like

Thanks Erik,

That explains the error. But I still need to find how to do the domain query.