Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Pull Distribution list with specific word in the DL name

Posted on 2010-11-17
8
Medium Priority
?
478 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:amku03
  • 3
  • 3
  • 2
8 Comments
 
LVL 71

Accepted Solution

by:
Chris Dent earned 1600 total points
ID: 34154846

Dead easy :)

Get-DistributionGroup *DL*

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

Chris
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 34154851

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

Chris
0
 

Author Comment

by:amku03
ID: 34154863
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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 49

Expert Comment

by:Akhater
ID: 34154878
get-distributiongroup | ? ($_.name -like "DL*")

0
 
LVL 49

Expert Comment

by:Akhater
ID: 34154883
Ok i should have refreshed sorry :)


DLs with ABC in the names

get-distributiongroup | ? ($_.name -like "*ABC*")
0
 
LVL 49

Assisted Solution

by:Akhater
Akhater earned 400 total points
ID: 34154897
and I got it wrong :D

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

or simply as per Chris

get-distributiongroup *ABC*
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 34154937

> 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
 

Author Closing Comment

by:amku03
ID: 34155029
thanks
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Stellar Exchange Toolkit: this 5 in 1 toolkit comes loaded with mega-software tool. Here’s an introduction to tools’ usage and advantages:
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question