13 lines
607 B
PowerShell
13 lines
607 B
PowerShell
# input the users email address you want to copy from
|
|
$source = "user1@domain.com.au"
|
|
|
|
# input the users email address you want to paste the groups to
|
|
$destination = "user2@domain.com.au"
|
|
|
|
Connect-ExchangeOnline
|
|
|
|
$dn = (Get-EXOMailbox $source).DistinguishedName
|
|
|
|
Get-EXORecipient -Filter "Members -eq '$dn'" -RecipientTypeDetails GroupMailbox | ForEach-Object { Add-UnifiedGroupLinks $_.Name -LinkType Member -Links $destination }
|
|
Get-EXORecipient -Filter "Members -eq '$dn'" -RecipientTypeDetails MailUniversalDistributionGroup | ForEach-Object { Add-DistributionGroupMember $_.Name -Member $destination }
|