how to set company for bulk contacts using cmdlet
Hello everyone,
Actually i am looking to set the company for around 1000 external contacts with exchange powershell cmdlet. how can i accomplish this.
I am using exchange server 2007 with windows server 2003 R2. What we want to accomplish is as follows
imported customers contacts in exchange to send them special offers periodically. The offers will be sent based on product they have.
i imported the contacts in exchange. made dynamic distribution group. entered product name in company field as we dont keep the company details of customer's company. this is because i can call the contact from dynamic distribution group based on product
as there is no product field in mail contact properties. Now the problem is only that how do i set the company information using exchange cmdlet for all the contacts at the same time.
Thanks,MYM
November 20th, 2010 4:11am
For change attribute in contact you need to get mail contact in an OU and supply this value into set-mailcontact cmdlet.
Get-MailContact -OrganizationalUnit "" | Set-MailContact -CustomAttribute9 ????
I did not test it with me, So please test it and then apply to all.Anil
Free Windows Admin Tool Kit Click here and download it now
November 20th, 2010 4:33am
Thanks Anil.
This is what i have done just to help out someone who is looking for it
step1
import from csv to exchange server using following command
Import-Csv Contacts.csv | ForEach { New-MailContact -Name $_.DisplayName -ExternalEmailAddress $_.EmailAddress -
OrganizationalUnit "MailContacts" }
step 2
add custom attribute 1 to all the customers by their product using the following command
get-mailcontact -orginationalunit 'Mcompany.local/mycontactsou' | get-mailcontact -customattribute1 'productName'
Step 3
hide the all the contacts from the global address list using the following command
get-mailcontact -orginationalunit 'mycompany.local/mycontactsou'| get-mailcontact -hiddenfromaddresslistenabled
$True
step 4
step5
create dynamic distribution list using EMC
After the creation of the dynamic distribution group go the the properties tab of the group and then to the
conditions tab and then select custom attribute1. then enter the value as the productName. and then click ok
step 6
hidde the dynamic distribution group using the following command
get-dynamicdistributiongroup -identity 'DynamicDistributionGroupName' | set-dynamicdistributiongroup -
hiddenfromaddresslistenabled $True
Thanks Anil for your help.Your post enabled me to complete the task sucessfully
MYM
November 20th, 2010 8:36am