Created
March 30, 2023 02:28
-
-
Save dallin/934b408bd1427f3065e91128f083ebc9 to your computer and use it in GitHub Desktop.
Create an "Everyone" distribution list with dynamic membership. Includes all active user accounts (no shared mailboxes) with a job title.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module ExchangeOnlineManagement | |
Connect-ExchangeOnline | |
New-DynamicDistributionGroup -Name "Everyone" -Alias "[email protected]" -RecipientFilter "RecipientTypeDetails -eq 'UserMailbox' -and Title -ne `$null -and UserAccountControl -ne 'AccountDisabled, NormalAccount'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment