playground:microsoft_365:exchange_online:office_365_tenant_to_tenant_migrations
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| playground:microsoft_365:exchange_online:office_365_tenant_to_tenant_migrations [2021/10/29 22:53] – [Distribution Group Migrations] admintomi | playground:microsoft_365:exchange_online:office_365_tenant_to_tenant_migrations [2021/10/29 23:16] (current) – [Distribution Group Migrations] admintomi | ||
|---|---|---|---|
| Line 13: | Line 13: | ||
| </ | </ | ||
| - | Exporting distribution lists members | + | And importing distribution lists. If importing another tenant, remember to clean onmicrosoft.com aliases and rename domains if needed. |
| + | < | ||
| + | |||
| + | Import-Csv C: | ||
| + | $proxyaddresses = $_.EmailAddresses -split ' ' | ||
| + | $managers = $_.ManagedBy -split ' ' | ||
| + | New-DistributionGroup -Name $_.DisplayName -ManagedBy $managers -PrimarySmtpAddress $_.PrimarySmtpAddress -RequireSenderAuthenticationEnabled $_.RequireSenderAuthenticationEnabled -WhatIf | ||
| + | Set-DistributionGroup -Identity $_.DisplayName -EmailAddresses @{add= $proxyaddresses} -WhatIf | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | Exporting distribution lists members. I borrowed this from Internet. Problem is that this script does not output nice .csv file, needs to be redesigned. | ||
| < | < | ||
| Line 32: | Line 44: | ||
| </ | </ | ||
| + | |||
| + | Lets say you add headers to file produced on previous script for example " | ||
| + | |||
| + | You can import members to new tenant with following command | ||
| + | |||
| + | < | ||
| + | Import-Csv C: | ||
| + | Add-DistributionGroupMember -Identity $_.DisplayName -Member $_.UserPrimarySMTP | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | Yet again pay attention to UPN if it needs to be changed before importing. | ||
playground/microsoft_365/exchange_online/office_365_tenant_to_tenant_migrations.1635537181.txt.gz · Last modified: 2021/10/29 22:53 by admintomi
