Solved

DL group contains a specific name

Posted on 2014-09-17
12
80 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 28

Expert Comment

by:becraig
Comment Utility
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
Comment Utility
thanks, it is asking for -resultsize unlimited command?
0
 
LVL 28

Expert Comment

by:becraig
Comment Utility
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
 

Author Comment

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

Expert Comment

by:becraig
Comment Utility
What do you get when you run:

Get-DistributionGroup -resultsize unlimited
0
 

Author Comment

by:kuzum
Comment Utility
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
Are your corporate email signatures appalling?

Is it scary how unprofessional your email signatures look? Do users create their own terrible designs and give themselves stupid job titles? You can make this a lot easier for yourself by choosing an email signature management solution from Exclaimer today.

 
LVL 28

Expert Comment

by:becraig
Comment Utility
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
Comment Utility
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
Comment Utility
any ideas please?
0
 
LVL 28

Accepted Solution

by:
becraig earned 500 total points
Comment Utility
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 28

Assisted Solution

by:becraig
becraig earned 500 total points
Comment Utility
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 28

Expert Comment

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

Featured Post

Want to promote your upcoming event?

Are you going to an event? Are you going to be exhibiting at a tradeshow? Talking at a conference? Using a promotional banner in your email signature ensures that your organization’s most important contacts stay in the know and can potentially spread the word about the event.

Join & Write a Comment

Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

728 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now