timgreen7077
asked on
Exchange 2010 Distribution Groups
Is there a script or cmdlets we can use to get all the distribution groups (not security groups) along with its members from an OU. Once we get it we can take that information and recreate the group and re-add the members to a different exchange org.
I suggest you to review your question again. As logically it is not possible.
Script is here to get all data about DLs and their members... But this data directly can't be imported to new forest but you will have to manipulate it to create bulk entities.
$saveto = "D:\Data\Members.txt"
Get-DistributionGroup -OrganizationalUnit "ou=sales,dc=domain,dc=local" | sort name | ForEach-Object {
"`r`n$($_.Name)`r`n=============" | Add-Content $saveto
Get-DistributionGroupMember $_ | sort Name | ForEach-Object {
If($_.RecipientType -eq "UserMailbox")
{
"," + $_.Name + " (" + $_.PrimarySMTPAddress + ")" | Add-Content $saveto
}
}
}
ASKER
I have tested this script already before I opened this case. I have a script I found online that I'm currently running and I think it may work just fine. The actual script you just mentioned I already had. I don't remember where I got the script but it's titled
DistributionGroupMemberRep ort.ps1
Once complete I will update and let you know how this worked.
DistributionGroupMemberRep
Once complete I will update and let you know how this worked.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
How are you going to add in different forest. You need to create all users again. Still I don't understand the logic, how you are going to implement it.
ASKER
This is the type of script I was looking for.