can't find calendar data for certain resource accounts

Jamro Chris 0 Reputation points
2025-01-29T15:20:42.2633333+00:00

I'm attempting to get info on some of our resource calendars. Since this doesn't function well within the EXO Powershell, I was pointed towards the MSGraph module.

So I use these commands:

 $StartDate = "2024-01-01T19:00:00-08:00"
>> $EndDate = "2024-12-31T19:00:00-08:00"
>> Get-MgUserCalendarView -UserId "xxx@xxx.xx" -All -StartDateTime $StartDate -EndDateTime $EndDate | Select-Object -Property @{Name='EventStart';Expression={ $_.Start.DateTime}},@{Name='EventEnd';Expression={ $_.End.DateTime}},Subject, BodyPreview | Export-CSV "c:\temp\xxx.csv"

And this works fine for almost every resource I have tried this on. But one set of resource mailboxes gives this as a result:

Get-MgUserCalendarView_List:
Line |
   3 |  Get-MgUserCalendarView -UserId "xxx@xxx.xx" -All -Star …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The specified object was not found in the store.

Status: 404 (NotFound)
ErrorCode: ErrorItemNotFound
Date:

Headers:
Cache-Control                 : private
Vary                          : Accept-Encoding
Strict-Transport-Security     : max-age=31536000
request-id                    : ab43f50a-55e9-49fa-a837-aca09feba628
client-request-id             : 607a9733-2835-4c51-8885-138338823e84
x-ms-ags-diagnostic           : {"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"009","RoleInstance":"AM1PEPF00027CA5"}}
Date                          : Tue, 07 Jan 2025 15:22:11 GMT

This set of resource mailboxes are coincidentally all made at about the same time, but they were made in the same way as other resource mailboxes and are (just like the other resource mailboxes) made in our EXO environment with no links to anything on-prem.

If I look for these resource accounts with a Get-MgUser I get results and I also used the ObjectID I found this way. But it gave the same results.

Does anyone have any idea what is going wrong?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,919 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,780 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Rajat Vashistha-MSFT 280 Reputation points Microsoft Vendor
    2025-01-30T10:24:35.2566667+00:00

    Hi Jamro Chris,

    Thank you for reaching out to Microsoft!

    It seems the issue is related to specific resource accounts. Here are a few steps you can check and try:

    1. Mailbox Configuration: Ensure that the resource mailboxes are not inactive, soft-deleted, or hidden from the Global Address List (GAL). Resource mailboxes need to be properly configured and active in the Microsoft 365 environment.
    2. Comparison: Compare the settings of the resource accounts that are working with those that are not. This might help identify any discrepancies.
    3. API Check: Please try using the following API with Calendars.ReadBasic or Calendars.Read Application Permissions to see if it runs successfully for those resource accounts:
        **GET** https://graph.microsoft.com/v1.0/Users/{UserPrincipalName}/calendar/events?                  $filter=startsWith(subject,'All')
      

    List Events

    Even after verifying the above, if the issue still persists, I recommend you raise a support case with Microsoft, a Support Engineer will be able to look into this issue and assist you better. You can raise support ticket from New support request - Microsoft Entra admin center or https://admin.microsoft.com/#/support/requests.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.