Site icon Office 365 for IT Pros

How to Report Recent Changes made to Distribution Lists

Track distribution list changes with PowerShell.
Advertisements

Distribution Lists are Entra ID Groups – Kind Of

A recent discussion about how to track changes in Microsoft 365 groups prompted the question about how to generate the same information about distribution list changes? The issue here is that distribution lists are not fully-fledged Entra ID objects. Instead, they are Exchange Online objects hosted in the Exchange Online Directory Store (EXODS) and synchronized to Entra ID. In fact, Exchange Online and Entra ID use a dual-write mechanism to make sure that changes made to distribution lists happen in both directories simultaneously. If the dual write fails for any reason, the update is not applied to either directory.

Although Entra ID knows about distribution lists, you cannot use the Entra ID Graph APIs to update distribution list properties or add or remove group members. Everything is done through Exchange Online.

Finding Audit Records for Distribution List Changes

All of which is a complicated way of saying that the technique used to report changes made to Microsoft 365 groups won’t work. Although the updates for distribution lists make their way into Entra ID and subsequently generate audit events for those changes, the “actor” (the process that updates Entra ID) is a system background job called Microsoft Substrate Management. To discover the human who update distribution lists, we must consult the audit events logged by Exchange Online rather than Entra ID.

Creating the Script to Report Distribution List Changes

In any case, I started by copying the script to report changes to Microsoft 365 groups so as to have the structure. I then made the following changes:

Figure 1: Email with the HTML report describing distribution list changes

Download the Script to Report Distribution List CHanges

You can download the script from the Office 365 for IT Pros GitHub repository. The nice thing about PowerShell is that if you don’t like the code, feel free to change it to meet your requirements. Be nice to the community and publish your updates through GitHub. You know that it makes sense!


Need help to write and manage PowerShell scripts for Microsoft 365, including Azure Automation runbooks? Get a copy of the Automating Microsoft 365 with PowerShell eBook, available standalone or as part of the Office 365 for IT Pros eBook bundle.

Exit mobile version