Dynamic distribution lists

Hi,

I want to create a dynamic distribution list that is not quite standard.

So most of my lists are like

-recipientfilter {office -like "*admin*"}

but I want one that looks at the manage field rather than the direct user, SO for example we have a larger number of staff with in the operations "team" which included HR, IT Finance ect.

image

USER, Department, manager

jo          development         Tess
james        development        Andrew
john         operations         Mary

Open in new window


my get-aduser filter would be

get-aduser -filter {department -eq development} | select manager

which would return the managers not the users them selves

Tess
Andrew

Open in new window


is there any way I can use the same kind of filter in a dynamic distribution list?
LVL 16
Aaron StreetTechnical Infrastructure Architecture and Global Network ManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jamie McKillopIT ManagerCommented:
Hello,

Dynamic distribution groups work based on a recipient filter. You can't add advanced logic to the filter. The filter can only look values on filterable properties that match or don't match values you specify in the filter.

To do what you want, I suggest an alternative method that I frequently use. Create a powershell script, similar to what you have above, to return the users you want in the DL. Create a non-dynamic DL and have the script update the membership, based on the users that are returned. You can then setup task scheduler to run the script on whatever schedule you want to update the DL.

-JJ

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Aaron StreetTechnical Infrastructure Architecture and Global Network ManagerAuthor Commented:
loks like the way to go :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.