DL for Contacts
Hello, In my "organization" we have 20% of Exchange accounts and 80% Linux Accounts. The Linux accounts are mail contact (New mail user & New mail contact). I need: 1) to get the list of all the mail users & mail contacts 2) I need to create a new distribution group named "Linux Contact" and copy all the mail users & mail contacts into that DG. Do you know how I could realize 1) and 2) using shell command?? Thanks u all for your assistance. Graig
November 27th, 2009 11:25am

I won't say it is the best way but for the part 1) I found: mail contact: Get-MailContact -resultsize unlimited | select displayname,alias,emailaddresses |fl > Mailcontact_full.txt mail user: Get-MailUser -resultsize unlimited | select displayname,alias,emailaddresses | fl > Mailuser_full.txt Please correct me if I am wrong. For the part 2) I forgot to say that the distribution group "Linux Contact" already exist. I just need a command to add all the bunch of users (mail users & mail contacts) to that DL. any idea??
Free Windows Admin Tool Kit Click here and download it now
November 27th, 2009 1:02pm

Hi, Can you please let us know an output of a mail user and a mail contact which belong to Linux accounts by below command? ON MS Exchange PS (Assuming that you have exchange 2007 in your org.) Get-mailcontact -id <Alias or displayname or name of a mail contact in Linux> | fl Get-mailuser -id <Alias or displayname or name of a mail user in Linux> | fl i think you can query on ExternalEmailaddress attribute of mail users and contacts. There may be other ways as well. Thanks.Vishal Ramnani | MCITP - Exchange 2007 | MCSE Messaging | MCTS - Win 2008 Config
November 27th, 2009 1:05pm

Ok. that will be ok but to have even better format, redirect output to a CSV file. Get-MailContact -resultsize unlimited | Export-csv c:\mailcontact.csv Get-MailUser -resultsize unlimited | Export-CSV C:\mailUser.csv but this will return all mail users and contacts in case you have any which doesn't belong to Linux accounts. For your second part, you can make use of Add-DistributionGroupMember. You may want to use below command if all contacts and mail users are for Linux accounts. Get-Mailcontact -resultsize unlimited | add-DistributionGroupMember -id "Linux Contact" -confirm:$false -whatif (Remove -whatif to add them in the DL) Same for Get-MailUser Hope this helps. Thanks.Vishal Ramnani | MCITP - Exchange 2007 | MCSE Messaging | MCTS - Win 2008 Config
Free Windows Admin Tool Kit Click here and download it now
November 27th, 2009 1:13pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics