Dynamic Distribution List Generator (PowerShell)

Description:
This script automates the creation of Dynamic Distribution Groups based on user attributes (e.g., department, title, or office) and applies filters to populate the group membership dynamically.

# Connect to Exchange Online (Modern Auth)
Connect-ExchangeOnline -UserPrincipalName [email protected]

# Define variables
$DLName = "DL-SLC-IT"
$RecipientFilter = "(Department -eq 'IT') -and (Office -eq 'Salt Lake City')"

# Create the Dynamic Distribution Group
New-DynamicDistributionGroup -Name $DLName -RecipientFilter $RecipientFilter

# Confirm creation
Get-DynamicDistributionGroup -Identity $DLName | Format-List Name,RecipientFilter
  • Customize $DLName and $RecipientFilter as needed for your organization.
  • This script assumes you have Exchange Online PowerShell V2 module installed.
  • Optional: Add -PrimarySmtpAddress or -DisplayName if you want a specific email format.

Dynamic DL Generator

Easily generate dynamic distribution lists in Exchange Online using custom filters and automated membership rules. Ideal for modern, policy-based email groups.

🔗 View on GitHub

© 2012–2025 Jet Mariano. All rights reserved.

For usage terms, please see the Legal Disclaimer.

error: Content is protected !!