banner



How To Create Dynamic Distribution Group

Cloud Help Desk: Delays for ticket imports:
  1. Home
  2. Cloud
  3. Microsoft Office 365

Hi,

I'm trying to create multiple  global dynamic distribution lists using exchange online to create all employees list & another department list based on (active user or sign-in allowed, job title, department & office location) for emailing and announcements.

the steps I'm taking to create the global all employees dynamic list as following:

- I login to the admin portal … go to admin centers … exchange
- Recipient … groups … create .. dynamic distribution list … I fill out the information and I click users with exchange mailboxes.

However, when I check it out .. it includes all users regardless if they are enabled or disabled.
Microsoft Engineer didn't help much as they offer a workaround that is not convenient and taking longer per user.

So back to my request, I'm looking to create 2 global dynamic distribution lists as following:

1- All Employees list .. with condition .. Active mailbox user (mailbox with a license) or sign-in allowed

2- Department list … with condition … Active Mailbox user (mailbox with a license) or Sign-in allowed, (Job title, Department, Office) based on the contact information for the user's mailbox.

3- I would like to check the membership in these groups to verify.

From my understanding, the task will accomplish through PowerShell. If you guys can provide me with the commands I truly appreciate it.

Thanks in advanced

Edited Sep 26, 2019 at 18:45 UTC
Mike_Choices
Mike_Choices This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 27, 2019 at 15:35 UTC

I reviewed the code I sent you and realized I missed a NOT.  Try this:

                          New-DynamicDistributionGroup "AllEmployees" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and -not (UserAccountControl -eq "AccountDisabled, NormalAccount"))}                        

I was able to get it to successfully work today to filter on a Recruitment distribution list based off the Department attribute being set to Recruitment and to exclude disabled accounts:

                          Set-DynamicDistributionGroup "Recruitment" -RecipientFilter {((Department -eq 'Recruitment') -and (RecipientType -eq 'UserMailbox') -and -not(UserAccountControl -eq "AccountDisabled, NormalAccount"))}                        
Edited Sep 27, 2019 at 16:10 UTC

19 Replies

Mike_Choices
Mike_Choices This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 26, 2019 at 18:49 UTC

Here's three examples of the Powershell commands to check the members of a Dynamic Distribution List.  Replace HR, Finance, IT with the names of your DDLs.

                                $FTE = Get-DynamicDistributionGroup "HR" Get-Recipient -RecipientPreviewFilter $FTE.RecipientFilter  $FTE = Get-DynamicDistributionGroup "Finance" Get-Recipient -RecipientPreviewFilter $FTE.RecipientFilter  $FTE = Get-DynamicDistributionGroup "IT" Get-Recipient -RecipientPreviewFilter $FTE.RecipientFilter                              
samelgo
samelgo This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 26, 2019 at 19:07 UTC

Cool, Thank you Mike.

What about the First & Second request?

Mike_Choices
Mike_Choices This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 26, 2019 at 19:12 UTC

1- All Employees list .. with condition .. Active mailbox user (mailbox with a license) or sign-in allowed

 Because of Room Mailboxes, Shared Mailboxes, Generic Mailboxes (ex. info@domain.com) I use a Custom Attribute that I assign to the users for the All Employees DDL.

2- Department list … with condition … Active Mailbox user (mailbox with a license) or Sign-in allowed, (Job title, Department, Office) based on the contact information for the user's mailbox.

 For Departments, I just use the Department field in AD.


samelgo
samelgo This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 26, 2019 at 19:24 UTC

That is what MS offered. however, if you have a high employees turnover … you will feel the pain every time you are adding/disabling.

any idea about powershell command will make it perfect?

Mike_Choices
Mike_Choices This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 26, 2019 at 19:26 UTC

I'm trying to understand why that solution isn't valid for you.  When you setup an employee you just have to add their department and when you delete them, they are obviously gone from the DDL.

samelgo
samelgo This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 26, 2019 at 19:33 UTC

We don't delete them … as they might get hired back.

For Department .. we need to have office included as we have the same department in another 28 locations.

Mike_Choices
Mike_Choices This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 26, 2019 at 19:37 UTC

Do you remove their mailbox when they leave?  If so you, rather than All recipient types you should be able to select Users with Exchange mailboxes.

samelgo
samelgo This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 26, 2019 at 19:38 UTC

We don't remove their mailboxes. for future use and reference.

Mike_Choices
Mike_Choices This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 26, 2019 at 19:44 UTC

Are you online only or using AD Connect to sync your users?

samelgo
samelgo This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 26, 2019 at 19:46 UTC

Online Only.

I appreciate your help. however, the only way to go is PowerShell. if I can get the correct parameter it will fix the issue.

samelgo
samelgo This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 26, 2019 at 20:03 UTC

New-DynamicDistributionGroup "AllEmployees" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and -not(UserAccountControl -eq'AccountDisabled') )}

Didn't work. blocked accounts still showing up.

Mike_Choices
Mike_Choices This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 26, 2019 at 20:10 UTC

Try

                                New-DynamicDistributionGroup "AllEmployees" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (UserAccountControl -eq "AccountDisabled, NormalAccount")}                              
samelgo
samelgo This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 26, 2019 at 21:01 UTC

I hate to tell you that it didn't work … same issue showing all disabled mailboxes.

Mike_Choices
Mike_Choices This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 27, 2019 at 15:35 UTC

I reviewed the code I sent you and realized I missed a NOT.  Try this:

                                New-DynamicDistributionGroup "AllEmployees" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and -not (UserAccountControl -eq "AccountDisabled, NormalAccount"))}                              

I was able to get it to successfully work today to filter on a Recruitment distribution list based off the Department attribute being set to Recruitment and to exclude disabled accounts:

                                Set-DynamicDistributionGroup "Recruitment" -RecipientFilter {((Department -eq 'Recruitment') -and (RecipientType -eq 'UserMailbox') -and -not(UserAccountControl -eq "AccountDisabled, NormalAccount"))}                              
Edited Sep 27, 2019 at 16:10 UTC
samelgo
samelgo This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 27, 2019 at 16:07 UTC

Mike,

First one is missing close parenthesis before the closing brace … after adding the close parenthesis symbol ")" it worked :D

Now task two :P be ready … I need the job title … department and office to be included in the filter ….

correct me if I'm mistaken with the following command:

Set-DynamicDistributionGroup "ILSales" -RecipientFilter {((Department -eq 'Sales') -and (RecipientType -eq 'UserMailbox') -and (Title -eq 'Sales') -and (Office -eq 'IL') -and not(UserAccountControl -eq "AccountDisabled, NormalAccount"))}

Does it looks good?

Mike_Choices
Mike_Choices This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 27, 2019 at 16:11 UTC

I updated the code in my previous post.  Just looks like you missed the - before not in your code.

                                Set-DynamicDistributionGroup "ILSales" -RecipientFilter {((Department -eq 'Sales') -and (RecipientType -eq 'UserMailbox') -and (Title -eq 'Sales') -and (Office -eq 'IL') -and -not (UserAccountControl -eq "AccountDisabled, NormalAccount"))}                              
samelgo
samelgo This person is a Verified Professional
This person is a verified professional.
Verify your account to enable IT peers to see that you are a professional.
Sep 27, 2019 at 16:23 UTC

Mike,

You made my day!

instead of Set- I used New- and it worked as it suppose to be …

New-DynamicDistributionGroup "ILSales" -RecipientFilter {((Department -eq 'Sales') -and (RecipientType -eq 'UserMailbox') -and (Title -eq 'Sales') -and (Office -eq 'IL') -and -not (UserAccountControl -eq "AccountDisabled, NormalAccount"))}

that is a huge thing for anyone that is going through the hassle of Dynamic Distribution Group List specially when you have thousands of mailboxes either active or not.

Thank you very much for the help :)

This topic has been locked by an administrator and is no longer open for commenting.

To continue this discussion, please ask a new question.

How To Create Dynamic Distribution Group

Source: https://community.spiceworks.com/topic/2234296-creating-dynamic-distribution-list-exchange-online

Posted by: cainrothe1964.blogspot.com

0 Response to "How To Create Dynamic Distribution Group"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel