Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403 Access Denied when accessing other users' mailboxes #1

Open
luckman212 opened this issue Jan 12, 2024 · 5 comments
Open

403 Access Denied when accessing other users' mailboxes #1

luckman212 opened this issue Jan 12, 2024 · 5 comments

Comments

@luckman212
Copy link

I've been trying to use this script and other various flavors of Get-MgUserMailboxSetting and GET /users/{user_id}?$select=mailboxSettings... Just keep hitting a wall with a 403 permission error. Anyone else having any luck?

Access is denied. Check credentials and try again.  Status: 403 (Forbidden) ErrorCode: ErrorAccessDenied

It works when I query my own mailboxSettings, but I can't retreive the settings for any other users in the Org. I am global admin and have connected to MgGraph with the MailboxSettings.Read and MailboxSettings.ReadWrite scopes, among others.

@luckman212
Copy link
Author

Maybe related: https://martin-machacek.com/blogPost/77d247ca-4c08-4782-b62d-57634a0c66de seems like a custom Azure App may be required...

@luckman212 luckman212 changed the title 403 Access Denied 403 Access Denied when accessing other users' mailboxes Jan 12, 2024
@luckman212
Copy link
Author

@luckman212
Copy link
Author

screenshot_7lG1dbKn

@MartinM85
Copy link
Owner

What I remember from my testing, with delegated permission MailboxSettings.Read or MailboxSettings.ReadWrite, you can't read mailbox settings of other users.

I have never found any note about this in the Graph doc, only in the description of the permission MailboxSettings.Read, similar to your screenshot.

It works with application permission MailboxSettings.Read.

@luckman212
Copy link
Author

I am not sure I know how to set up and authenticate as the custom application (yet). Will have to research that, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants