Girija Purandare
Girija Purandare

Reputation: 51

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?

Upvotes: 0

Views: 102

Answers (1)

Rukmini
Rukmini

Reputation: 16064

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.

  • You can use message trace from the Microsoft 365 Defender portal or Compliance Center to get detailed logs of emails sent to a particular DL. This data includes when the emails were delivered.
  • But it can trace recent period.
  • You can query for specific actions related to the DL but it requires Audit Log permissions.

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.

Upvotes: 1

Related Questions