Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

DL group contains a specific name

Posted on 2014-09-17
12
Medium Priority
?
129 Views
Last Modified: 2014-11-18
how do you searh for  a specific distubution group in Exchange 2010 via powershell

for example all the groups starts with or ends with "partner"

I need list of all the DLs in our enviroment
0
Comment
Question by:kuzum
  • 7
  • 5
12 Comments
 
LVL 29

Expert Comment

by:becraig
ID: 40328258
Get-DistributionGroup | ? {$_.Name -like "partner*" -or $_.Name -like "*partner"} | export-csv c:\dlreport.csv -nti

Open in new window

That should do it
0
 

Author Comment

by:kuzum
ID: 40328284
thanks, it is asking for -resultsize unlimited command?
0
 
LVL 29

Expert Comment

by:becraig
ID: 40328328
should be optional but you can add it.

Get-DistributionGroup -ResultSize Unlimited | ? {$_.Name -like "partner*" -or $_.Name -like "*partner"} | export-csv c:\dlreport.csv -nti

Open in new window

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:kuzum
ID: 40328364
received this;
WARNING: The property value is invalid. The value can't contain leading or trailing whitespace"  ?
0
 
LVL 29

Expert Comment

by:becraig
ID: 40328385
What do you get when you run:

Get-DistributionGroup -resultsize unlimited
0
 

Author Comment

by:kuzum
ID: 40328415
received
Name                          DisplayName                   GroupType                     PrimarySmtpAddress
   xx                                        xx                                         xx                                        xx

where xx  is details

and below warning

WARNING: The object ourdomain.com/NR Groups/NR Distribution Groups/China/Hong Kong/Sync to All/Support
Heads has been corrupted, and it's in an inconsistent state. The following validation errors happened:
WARNING: Property expression "Asia-ITSupport(Heads)" isn't valid. Valid values are: Strings formed with characters from
 A to Z (uppercase or lowercase), digits from 0 to 9, !, #, $, %, &, ', *, +, -, /, =, ?, ^, _, `, {, |, } or ~. One or
 more periods may be embedded in an alias, but each period should be preceded and followed by at least one of the other
 characters. Unicode characters from U+00A1 to U+00FF are also valid in an alias, but they will be mapped to a best-fit
 US-ASCII string in the e-mail address, which is generated from such an alias.
0
 
LVL 29

Expert Comment

by:becraig
ID: 40329130
ok so that is the problem you have DLs that do not match the required naming conventions and need to be updated :~(

You need to update this to not be Asia-ITSupport(Heads)
Find that DL and edit it.
you can probably update to Asia-ITSupport-Heads


Then try again
0
 

Author Comment

by:kuzum
ID: 40329913
when I search in GUI and said alias contains the word I want it finds it all. SO please amend the code to say alias contains "partner"
0
 

Author Comment

by:kuzum
ID: 40330178
any ideas please?
0
 
LVL 29

Accepted Solution

by:
becraig earned 1500 total points
ID: 40330244
Shay Levi has a fix for this at his blog:
http://blogs.microsoft.co.il/scriptfanatic/2011/08/15/exchange-removing-illegal-alias-characters-using-powershell/


you can give the script a once over, you should be able to run it against all your DLs and it will clean up the naming.
0
 
LVL 29

Assisted Solution

by:becraig
becraig earned 1500 total points
ID: 40330256
I am guessing you are asking to have the query just get it once it contains partner and not if it starts or ends with partner ?

Get-DistributionGroup -ResultSize Unlimited | ? {$_.Name -like "*partner*"} | export-csv c:\dlreport.csv -nti

Open in new window

0
 
LVL 29

Expert Comment

by:becraig
ID: 40347699
Did you perform a cleanup on your DL names and did the script above fetch the required output ?
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

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

There are literally thousands of Exchange recovery applications out there. So how do you end up picking one that’s ideal for your business & purpose? By carefully scouting the product’s features, the benefits it offers you, & reading ample reviews f…
Welcome to 2018! Exciting things lie ahead in the world of tech. To start things off, we compiled great member articles on how to stay safe, ways to learn, and much more! Read on to start your new year right.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Screencast - Getting to Know the Pipeline
Suggested Courses

580 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