Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 10:30 AM (PST)
Microsoft Tech Community

How can I search by subject in all users' emails?

Copper Contributor

I am trying to search mails in all users mailbox by subject. I am trying to use "searchEntity: query":


To be able to use "searchEntity: query" i need this permissons: Mail.Read, Calendars.Read, Files.Read.All, Sites.Read.All, ExternalItem.Read.All


But there is no ExternalItem.Read.All permission on azures request api permissions.



1. How can i solve this issue
2. Is there another way to search mails in all users' emails?
2 Replies
ExternalItem.Read.All is a delegate-level permission, you seem to be looking at the application-level ones. If your goal is to search mailboxes, I'd stick to the Mail API endpoints and/or EWS.
Or using compliance center and content search is the easiest way to search all mailboxes. Assuming you have the permission and access needed. But same goes for searching mailboxes any other way you need to access but with compliance center if you have the role you have access to search all boxes easily.