Use Application access policies: https://practical365.com/application-access-policies-in-exchange-online/
How to restrict msgrapgh access to one mailbox only
Hi,
I am writing a powershell script using Microsoft graph to get the count of unread emails from the mailbox. I have given the applications permissions for my script to retrieve the count of unread email from the mailbox.
As I have given mail.ReadAll application permission to my script, it can access all the users mailboxes in my organization, however I want to restrict microsoft graph to one specific mailbox only, so it can access the mailbox of that user, but can't access any other users mailbox.
How can I achieve this restriction using Microsoft graph with powershell script?
Any pointers or help is appreaciated.
4 answers
Sort by: Most helpful
-
-
Ravindra Shukla 116 Reputation points
2021-05-12T06:59:11.53+00:00 -
Ravindra Shukla 116 Reputation points
2021-05-12T07:31:05.72+00:00 Hi @Vasil Michev ,
I have one more query regarding Microsoft graph.
Can we use serviceaccount to retrieve the Microsoft O365 resources using Microsoft graph, instead of using any specific user's mailbox account ?
Could you please share if this is possible and how to achieve this?
Thank you.
-
Ravindra Shukla 116 Reputation points
2021-05-17T13:47:03.69+00:00 @Vasil Michev One more query popped up in my mind.
"Mail.ReadAll" application permission, as the name suggests it reads mails from all the mailboxes in the tenant.
So it covers individual user mailboxes as well as shared mailbox, is this correct?
Please confirm
Thank you.