SFB project experience-61-cross-forest migration distribution group-Export the Distribution Groups
SFB project experience-61-cross-forest migration distribution group-Export the Distribution Groups
User requirements:
When customers migrate Exchange 2010 to 2010 across forests, they need to migrate a lot of communication groups, including many users.
How to migrate is the easiest and most convenient?
Batch migration of distribution groups across forests can be achieved through the following steps.
Solution:
*********************
1. User domain (export-distribution group)
*********************
# # #
Active Directory Module (ADM) for Windows PowerShell
# # #
Export the Distribution Groups
Get-ADGroup-Filter {GroupCategory-eq "Distribution"} | select Name | Export-Csv-Path "c:\ Export\ DGList.csv"
*********************
two。 Target Domain (Import-Distribution Group)
*********************
&
Exchange Management Shell
&
Imported the distribution groups
Import-Csv "C:\ Export\ DGList.csv" | ForEach {New-DistributionGroup-Name $_ .Name}
* *
3. User domain (export-distribution group-medium-user)
* *
# # #
Active Directory Module (ADM) for Windows PowerShell
# # #
Get-ADGroup-Filter {GroupCategory-eq "Distribution"} | ForEach-Object {
$group=$_
$users=Get-ADGroupMember-Identity $group
Foreach ($dguser in $users) {
New-Object-TypeName PSobject-Property @ {
SAM=$dguser.SamAccountName
Group=$group.name
}
}
} | Export-Csv-Path "c:\ Export\ DGusers.csv"
# TYPE System.Management.Automation.PSCustomObject
"SAM", "Group"
"user1", "DG1"
"user2", "DG1"
"user3", "DG2"
"user3", "DG2"
"user1", "DG3"
"user3", "DG3"
* *
4. Target domain (Import-Distribution Group-medium-user)
* *
&
Exchange Management Shell
&
Import-Csv "C:\ Export\ DGusers.csv" | ForEach {Add-DistributionGroupMember-Identity $_ .Group-Member $_ .SAM}