azure-ad-graph-apidistribution-list

Is it possible to get when a DL was used for last time using graph API


Is it possible to figure out in Microsoft office365, what was the last time when a mail/message is delivered to a particular list. What access will be required for this?


Solution

  • Note that: Microsoft Graph API does not directly provide a way to track the last time a Distribution List (DL) or Mailing List was used or when a message was last delivered to it.

    Otherwise as an alternate, use Microsoft Graph API allows to query mailboxes and interactions (e.g., through /me/messages or /users/{id}/messages), but this doesn't give direct delivery information to DLs.

    GET https://graph.microsoft.com/v1.0/me/messages
    

    enter image description here

    Try Start-HistoricalSearch command, it can retrieve message trace data up to 90 days. However, this still does not provide direct "last access" time for DLs across the entire organization.

    Hence there’s no direct method via Graph API to track the last time a DL was used. You will need to rely on message trace, audit logs, or PowerShell for this information, but each has limitations in terms of the time period they cover.