Pull Distribution list with specific word in the DL name

Exchange 2007 SP1 RU8

I need to pull / search all the Distribution list with a specific word say ABC in the DL name.
We have the DL name format as DL-NAM-NY-ABC Team

Looking for a powershell script to do this.
amku03Asked:
Who is Participating?
 
Chris DentConnect With a Mentor PowerShell DeveloperCommented:

Dead easy :)

Get-DistributionGroup *DL*

We can do pattern matching if you want more complex things.

Chris
0
 
Chris DentPowerShell DeveloperCommented:

PS the command above should be run from the Exchange Management Shell, or any shell with the Exchange CmdLets loaded.

Chris
0
 
amku03Author Commented:
Thanks, but I am aware of this.
I am looking to pull specific DLs with specific word in their names.

Like DL-NAM-NY-ABC Team1
DL-EUR-SW-ABC Team5

So I want to pull such DLS with ABC in their name...

Any suggestions??
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
AkhaterCommented:
get-distributiongroup | ? ($_.name -like "DL*")

0
 
AkhaterCommented:
Ok i should have refreshed sorry :)


DLs with ABC in the names

get-distributiongroup | ? ($_.name -like "*ABC*")
0
 
AkhaterConnect With a Mentor Commented:
and I got it wrong :D

get-distributiongroup | ? {$_.name -like "*ABC*"}

or simply as per Chris

get-distributiongroup *ABC*
0
 
Chris DentPowerShell DeveloperCommented:

> I am looking to pull specific DLs with specific word in their names.

This is exactly what I gave you, what do you want beyond that?

Chris
0
 
amku03Author Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.