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

Object Not Found in Store When Running Get-MgUserMailFolder #622

Closed
iperry-indigex opened this issue Apr 14, 2021 · 2 comments
Closed

Object Not Found in Store When Running Get-MgUserMailFolder #622

iperry-indigex opened this issue Apr 14, 2021 · 2 comments

Comments

@iperry-indigex
Copy link

iperry-indigex commented Apr 14, 2021

Running Powershell 7.1.3, see example below.

PS C:\Users\iperry> Connect-MgGraph -Scopes "User.Read.All","Mail.Read","MailboxSettings.Read"
Welcome To Microsoft Graph!
PS C:\Users\iperry> $Members = Get-MgUser -All | Where-Object {$_.UserPrincipalName -NotLike "*#*"}
PS C:\Users\iperry> Get-MgUserMailFolder -UserId $Members[4].Id
Get-MgUserMailFolder_List: The specified object was not found in the store., The process failed to get the correct properties.

I've attempted Connect-MgGraph -ForceRefresh, as well as Disconnect-MgGraph; Connect-MgGraph. I've also verified that the user is a legitimate user. Suggestions?
AB#8987

@ghost ghost added the ToTriage label Apr 14, 2021
@ghost ghost added this to Issues to triage in Graph SDK - Triage Apr 14, 2021
@peombwa
Copy link
Member

peombwa commented Apr 14, 2021

This is a service issue. Could you try the following?

  • From the docs, you can only get the mailbox folder collection of the signed-in user when in delegated mode. To get the mailbox folder of another user, you will need to authenticate in app-only mode via Connect-MgGraph -ClientId $env:ClientId -TenantId $TenantId -CertificateThumbprint $CertThumbprint.
  • Was the user account created recently? If so, you may need to wait for 15 minutes before making the call.

@peombwa peombwa self-assigned this Apr 14, 2021
@peombwa peombwa removed this from Issues to triage in Graph SDK - Triage Apr 14, 2021
@peombwa peombwa added this to To do in Graph SDK - Powershell via automation Apr 14, 2021
@iperry-indigex
Copy link
Author

That (The app-only mode) seems to have been it, thank you.

Graph SDK - Powershell automation moved this from To do to Done Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants