I just created 300 new distribution lists on our mixed Exchange environment. These new DLs, all needed a manager assigned to them.
The script below requires/uses cmdlets from the Microsoft Exchange 2007 Shell. For one that doesn't need them, check out Brandon's blog.
$mgr = "Eric Woodford"
$mgrMbx = Get-Mailbox -Identity $mgr
$mgrAEA = $mgrMbx.LinkedMasterAccount
$GroupDN = Get-DistributionGroup -Identity "All Users Distribution Group"
#Use this to assign it to the Associated External Account
$GroupDN | Add-ADPermission -User $mgrAEA -AccessRights WriteProperty
#Or this to assign to the local mailbox
#$GroupDN | Add-ADPermission -User $mgrmbx -AccessRights WriteProperty
$GroupDN | Set-Group -ManagedBy $mgr
Comments
Post new comment