Paolo Caparrelli Exchange Server 22 June 2022
With the Set-DistributionGroup command and the pipe above, select all groups and then apply the property to Administrator
Get-DistributionGroup | Set-DistributionGroup -managedby "System Administrator"
The next example, on the other hand, is much more selective:
Get-DistributionGroup -Managedby "xxxx" | Set-DistributionGroup -managedby "xxxx"
Finally, the example for dynamic distribution lists:
Get-DynamicDistributionGroup -Managedby "xxxx" | Set-DynamicDistributionGroup -managedby'xxx'