Solved

DL group contains a specific name

Posted on 2014-09-17
12
94 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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 500 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 500 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

724 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