Create Dynamic Distribution List/ Group via PowerShell. Below are the cmdlets to create one:
1. Run PowerShell as an Administrator.
2. Connect-ExchangeOnline
New-DynamicDistributionGroup -Name "Group Name" -RecipientFilter "(RecipientTypeDetails -eq 'UserMailbox')"
Note: The above cmdlet will create a Dynamic Distribution List with a custom attribute to add members on the basis of their mailbox. However, you can use multiple filters/ rules to add users to the Distribution List Group as per your requirement defined below :
AcceptMessagesOnlyFrom, AcceptMessagesOnlyFromBL,
AcceptMessagesOnlyFromDLMembers, AcceptMessagesOnlyFromDLMembersBL, ActiveSyncAllowedDeviceIDs,
ActiveSyncBlockedDeviceIDs, ActiveSyncDebugLogging, ActiveSyncEnabled, ActiveSyncMailboxPolicy,
ActiveSyncSuppressReadReceipt, AddressBookFlags, AddressBookPolicy, AddressListMembership, AdminDisplayName,
AdministrativeUnits, AggregatedMailboxGuids, AggregatedMailboxGuidsRaw, AggregationSubscriptionCredential, Alias,
AllowedAttributesEffective, AllowUMCallsFromNonUsers, Altitude, AltSecurityIdentities, ApprovalApplications,
ArbitrationMailbox, ArchiveDatabase, ArchiveDatabaseRaw, ArchiveDomain, ArchiveGuid, ArchiveName, ArchiveQuota,
ArchiveRelease, ArchiveState, ArchiveStatus, ArchiveWarningQuota, AssistantName, AttributeMetadata, AuditAdminFlags,
AuditBypassEnabled, AuditDelegateAdminFlags, AuditDelegateFlags, AuditEnabled, AuditLastAdminAccess,
AuditLastDelegateAccess, AuditLastExternalAccess, AuditLogAgeLimit, AuditOwnerFlags, AuditStorageState,
AuthenticationPolicy
BlockedSendersHash, BypassModerationFrom, BypassModerationFromBL, BypassModerationFromDLMembers,
BypassModerationFromDLMembersBL
CalculatedMemberBL, CalendarLoggingQuota, CalendarRepairDisabled,
CallAnsweringAudioCodec2, CallAnsweringAudioCodecLegacy, CatchAllRecipientBL, Certificate, CertificateSubject, City,
Co, CoManagedBy, CoManagedObjectsBL, CommonName, Company, ComplianceTagHoldApplied, ConfigurationBitmapRaw,
ConfigurationUnit, ConfigurationXMLRaw, ConsumerNetID, CorrelationId, CorrelationIdRaw, CountryCode, CountryOrRegion,
CustomAttribute1, CustomAttribute10, CustomAttribute11, CustomAttribute12, CustomAttribute13, CustomAttribute14,
CustomAttribute15, CustomAttribute2, CustomAttribute3, CustomAttribute4, CustomAttribute5, CustomAttribute6,
CustomAttribute7, CustomAttribute8, CustomAttribute9
Database, DataEncryptionPolicy, DefaultPublicFolderMailbox,
DefaultPublicFolderMailboxSmtpAddress, DelayHoldApplied, DelayReleaseHoldApplied, DelegateListBL, DelegateListLink,
DeletedItemFlags, DeliverToMailboxAndForward, DeliveryMechanism, Department, Description,
DesiredMailboxWorkloadsModified, DirectReports, DirSyncAuthorityMetadata, DirSyncId, DisabledArchiveDatabase,
DisabledArchiveGuid, DisplayName, DisplayType, DisplayTypeEx, DistinguishedName, DLSupervisionList
ElcExpirationSuspensionEndDate, ElcExpirationSuspensionStartDate, ElcMailboxFlags, ElcPolicyTemplate, EmailAddresses,
EmailAddressPolicyEnabled, EnforcedTimestamps, EntryId, EwsApplicationAccessPolicy, EwsEnabled, EwsExceptions,
EwsWellKnownApplicationAccessPolicies, ExchangeGuid, ExchangeObjectId, ExchangeObjectIdRaw,
ExchangeSecurityDescriptorRaw, ExchangeUserAccountControl, ExchangeVersion, ExcludedFromBackSync, ExpansionServer,
ExtensionCustomAttribute1, ExtensionCustomAttribute2, ExtensionCustomAttribute3, ExtensionCustomAttribute4,
ExtensionCustomAttribute5, ExternalDirectoryObjectId, ExternalEmailAddress, ExternalOofOptions, ExternalSyncState
Fax, FirstName, ForeignGroupSid, ForwardingAddress, ForwardingAddressBL, ForwardingSmtpAddress
GeneratedOfflineAddressBooks, GenericForwardingAddress, GrantSendOnBehalfTo, GrantSendOnBehalfToBL,
GroupExternalMemberCount, GroupMemberCount, GroupSubtypeName, GroupType, Guid
HABSeniorityIndex,
HABShowInDepartments, HasActiveSyncDevicePartnership, Heuristics, HiddenFromAddressListsEnabled,
HiddenFromAddressListsValue, HiddenGroupMembershipEnabled, HomeMTA, HomePhone
Id, IgnoreMissingFolderLink,ImapEnabled, ImmutableId, ImmutableSid, IncludedRecipients, IncludeInGarbageCollection, IndexedPhoneNumbers,
InformationBarrierSegments, Initials, InPlaceHolds, InPlaceHoldsRaw, IntendedMailboxPlan,
InternalRecipientSupervisionList, InternalUsageLocation, InternetEncoding, IsCalculatedTargetAddress, IsDefault,
IsDefault_R3, IsDirSynced, IsExcludedFromServingHierarchy, IsHierarchyReady, IsHierarchySyncEnabled,
IsInactiveMailbox, IsLinked, IsMachineToPersonTextMessagingEnabled, IsMailboxEnabled, IsMonitoringMailbox,
IsOrganizationalGroup, IsPersonToPersonTextMessagingEnabled, IsPilotMailboxPlan, IsResource, IsSecurityPrincipal,
IsShared, IsSoftDeletedByDisable, IsSoftDeletedByRemove, IssueWarningQuota, IsVIP,
JoinedSmtpAddress,JournalArchiveAddress
LabelAssignments, LanguagesRaw, LastExchangeChangedTime, LastName, Latitude,
LdapRecipientFilter, LegacyExchangeDN, LegacyExchangeDNRaw, LinkedPartnerGroupAndOrganizationId, LinkMetadata,
LitigationHoldDate, LitigationHoldEnabled, LitigationHoldOwner, LocaleID, LocalizationFlags, Longitude
MailboxContainerGuid, MailboxDatabasesRaw, MailboxFolderSet, MailboxGuidsRaw, MailboxLocationsRaw,
MailboxMoveBatchName, MailboxMoveFlags, MailboxMoveRemoteHostName, MailboxMoveSourceArchiveMDB, MailboxMoveSourceMDB,
MailboxMoveStatus, MailboxMoveTargetArchiveMDB, MailboxMoveTargetMDB, MailboxPlan, MailboxPlanIndex,
MailboxPlanRelease, MailboxRelease, MailboxStatus, MailTipTranslations, ManagedBy, ManagedFolderMailboxPolicy,
Manager, MAPIEnabled, MapiRecipient, MasterAccountSid, MasterDirectoryObjectId, MasterDirectoryObjectIdRaw,
MaxBlockedSenders, MaxReceiveSize, MaxSafeSenders, MaxSendSize, MemberDepartRestriction, MemberJoinRestriction,
MemberOfGroup, MessageHygieneFlags, MobileAdminExtendedSettings, MobileFeaturesEnabled, MobileMailboxFlags,
MobilePhone, ModeratedBy, ModeratedObjectsBL, ModerationEnabled, ModerationFlags
Name, NetID, NonCompliantDeviceLinksRaw, NonCompliantDevices, Notes, NTSecurityDescriptor
ObjectCategory, ObjectClass, Office, OfflineAddressBook, OlcDat2Flags, OneOffSupervisionList, OnPremisesObjectId, OperatorNumber, OrganizationalUnitRoot,
OrgLeaders, OriginalNetID, OtherDisplayNames, OtherFax, OtherHomePhone, OtherMobile, OtherTelephone, OWAEnabled,
OWAforDevicesEnabled, OwaMailboxPolicy, Owners
Pager, PartnerLabeledURI, PasswordLastSetRaw, PersistedCapabilities,
Phone, PhoneProviderId, PhoneticCompany, PhoneticDepartment, PhoneticDisplayName, PhoneticFirstName, PhoneticLastName,
PoliciesExcluded, PoliciesIncluded, PopEnabled, PostalCode, PostOfficeBox, PreviousDatabase, PreviousExchangeGuid,
PreviousExternalDirectoryObjectId, PreviousRecipientTypeDetails, PrimaryGroupId, PrimarySmtpAddress,
ProhibitSendQuota, ProhibitSendReceiveQuota, ProtocolSettings, ProvisioningFlags, PublicFolderClientAccess,
PublicFolderContacts, PurportedSearchUI
QueryBaseDN
RawCanonicalName, RawCapabilities, RawExternalEmailAddress,
RawIssueWarningQuota, RawManagedBy, RawName, RawOnPremisesObjectId, RawProhibitSendQuota, RawProhibitSendReceiveQuota,
RawRecoverableItemsQuota, RawRecoverableItemsWarningQuota, RecipientContainer, RecipientDisplayType,
RecipientDisplayTypeRaw, RecipientFilter, RecipientFilterMetadata, RecipientLimits, RecipientSoftDeletedStatus,
RecipientType, RecipientTypeDetails, RecipientTypeDetailsValue, RecoverableItemsQuota, RecoverableItemsWarningQuota,
RejectMessagesFrom, RejectMessagesFromBL, RejectMessagesFromDLMembers, RejectMessagesFromDLMembersBL,
RemoteAccountPolicy, RemotePowerShellEnabled, RemoteRecipientType, ReplicablePropertyChangedVersion,
ReplicationSignature, ReportToManagerEnabled, ReportToOriginatorEnabled, RequireAllSendersAreAuthenticated,
ResourceBehaviorOptions, ResourceCapacity, ResourceCustom, ResourceMetaData, ResourcePropertiesDisplay,
ResourceProvisioningOptions, ResourceSearchProperties, ResourceType, RetainDeletedItemsFor, RetentionComment,
RetentionPolicy, RetentionUrl, RMSComputerAccounts, RoleAssignmentPolicy, RoleGroupType, RoleGroupTypeId, RtcSipLine,
RTCSIPPrimaryUserAddress, RulesQuota
SafeRecipientsHash, SafeSendersHash, SamAccountName, SCLDeleteThresholdInt,
SCLJunkThresholdInt, SCLQuarantineThresholdInt, SCLRejectThresholdInt, SecurityProtocol, SendDeliveryReportsTo,
SendOofMessageToOriginatorEnabled, ServerLegacyDN, ServerName, ShadowAlias, ShadowAssistantName, ShadowC, ShadowCity,
ShadowCo, ShadowCompany, ShadowCountryCode, ShadowDepartment, ShadowDisplayName, ShadowEmailAddresses, ShadowFax,
ShadowFirstName, ShadowHomePhone, ShadowInitials, ShadowLastName, ShadowManager, ShadowMobilePhone, ShadowNotes,
ShadowOffice, ShadowOtherFax, ShadowOtherHomePhone, ShadowOtherTelephone, ShadowPager, ShadowPhone, ShadowPostalCode,
ShadowStateOrProvince, ShadowStreetAddress, ShadowTelephoneAssistant, ShadowTitle, ShadowWebPage,
ShadowWhenSoftDeleted, ShadowWindowsLiveID, SharedEmailDomainStateLastModified, SharedEmailDomainTenant,
SharedWithReference, SharedWithTargetSmtpAddress, SharePointLinkedBy, SharePointSiteInfo, SharePointUrl,
SharingAnonymousIdentitiesRaw, SharingPartnerIdentitiesRaw, SharingPolicy, Sid, SidHistory, SidRaw, SimpleDisplayName,
SingleItemRecoveryEnabled, SKUAssigned, SMimeCertificate, SourceAnchor, SPOHoldEnabled, StateOrProvince,
StreetAddress, StsRefreshTokensValidFrom, SystemMailboxRetainDeletedItemsFor, SystemMailboxRulesQuota,
TeamMailboxExpiration, TeamMailboxShowInClientList, TelephoneAssistant, TextEncodedORAddress, TextMessagingState,
ThrottlingPolicy, ThumbnailPhoto, Title, TransportSettingFlags
UCSImListMigrationCompleted, UMAddresses,
UMCallingLineIds, UMDtmfMap, UMEnabled, UMEnabledFlags, UMEnabledFlags2, UMMailboxPolicy, UMPinChecksum,
UMProvisioningRequested, UMRecipientDialPlanId, UMServerWritableFlags, UMSpokenName, UnicodePassword,
UnifiedGroupAccessType, UnifiedGroupActivityStatus, UnifiedGroupSecurityFlags, UnifiedMailboxAccount, UpgradeRequest,
UpgradeStatus, UsageLocation, UseDatabaseQuotaDefaults, UserAccountControl, UserPrincipalName, UserPrincipalNameRaw,
UseUCCAuditConfig, UsnChanged, UsnCreated
VoiceMailSettings
WasInactiveMailbox, WebPage, WellKnownObject,
WhenChanged, WhenChangedRaw, WhenChangedUTC, WhenCreated, WhenCreatedRaw, WhenCreatedUTC, WhenMailboxCreated,
WhenReplicablePropertyChangeMessageLastSubmitted, WhenReplicablePropertyLastChanged, WhenSoftDeleted,
WindowsEmailAddress, WindowsLiveID, YammerGroupAddress.
Supported expression operators:
The following table lists all the supported operators and their syntax for a single expression. Operators can be used with or without the hyphen (-) prefix.
Operator | Syntax |
---|---|
Not Equals | -ne |
Equals | -eq |
Not Starts With | -notStartsWith |
Starts With | -startsWith |
Not Contains | -notContains |
Contains | -contains |
Not Match | -notMatch |
Match | -match |
In | -in |
Not In | -notIn |
And -and
OR -or
Comments
0 comments
Please sign in to leave a comment.