export contacts
I'm using follwing script to export all my user ;$contacts | export-csv contacts.csv -notype$contacts = get-recipient -resultsize unlimited | select name,alias,primaryaddressAnd on exchange 2010 i'm using to import follwing code;Import-CSV C:\Contacts.csv | ForEach-Object { New-MailContact -Name $_."Name" -DisplayName $_."Name" -Alias $_."Alias" -ExternalEmailAddress $_."PrimarySmtpAddress" }
But i'm planning a migration from exc2007 to exc2010.i will use smtp namespace sharing scenario.But necessary of this scenario is ,there must be contacts for migrated users for mail flow.I used above script but on the target domain i need goup membership information of my contacts.Is it possible that exporting all my mailbox enabled users to csv with group membership information,and import into another exchange as contact with groups that they belong(all groups will be created before importing)
March 15th, 2010 1:20pm
On Mon, 15 Mar 2010 10:20:40 +0000, biblo45 wrote:>>>I'm using follwing script to export all my user ;$contacts | export-csv contacts.csv -notype$contacts = get-recipient -resultsize unlimited | select name,alias,primaryaddressAnd on exchange 2010 i'm using to import follwing code;Import-CSV C:\Contacts.csv | ForEach-Object { New-MailContact -Name $_."Name" -DisplayName $_."Name" -Alias $_."Alias" -ExternalEmailAddress $_."PrimarySmtpAddress" } >>But i'm planning a migration from exc2007 to exc2010.i will use smtp namespace sharing scenario.But necessary of this scenario is ,there must be contacts for migrated users for mail flow.I used above script but on the target domain i need goup membership information of my contacts.Is it possible that exporting all my mailbox enabled users to csv with group membership information,and import into another exchange as contact with groups that they belong(all groups will be created before importing) PowerShell doesn't expose the "memberof" property. You can, however,use ADSI.$c = [ADSI]("LDAP://" + (get-recipient $_).distinguishedname)$m = $c.memberofYou'll get the DN of each group. From there, if the groups are namedidentically in both forests, you can get the name of the group and addit to your CSV file.Dealing with multiple group memberships in a CSV file means that oneof the properties is going to be a list. You'll have to deal with thelist in the import script to add the object to each group.---Rich MatheisenMCSE+I, Exchange MVP---
Rich Matheisen
MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
March 15th, 2010 6:33pm
Please remember the [adsi]"LDAP part is uppercase sensitiveJames Luo TechNet Subscriber Support (http://technet.microsoft.com/en-us/subscriptions/ms788697.aspx) If you have any feedback on our support, please contact tngfb@microsoft.com
March 17th, 2010 9:20am