How to edit message delivery restrictions for distribution group via PS?
Hi, I need to edit some distribution group to accept messages from new user. I tried with this: Get-DistributionGroup | where {$_.AcceptMessagesOnlyFromSendersOrMembers -ne $null} | Set-DistributionGroup -AcceptMessagesOnlyFromSendersOrMembers Rajco but that command set accept delivery only for new user(rajco) and I need to add this user and old to keep permision. Thank!
January 10th, 2012 7:36am

Hi Please take your time and ammend this to suite your requirements, this helps you ammend one distribution list, Iam sure you can modify to cater for more groups $DG = Get-DistributionGroup "Your Group" Get-DistributionGroupMember "tempDG" | foreach {$DG.acceptmessagesonlyfrom += $_.DistinguishedName} Set-DistributionGroup "Your Group" -AcceptMessagesOnlyFrom $DG.acceptmessagesonlyfromRegards Herbert Zimbizi
Free Windows Admin Tool Kit Click here and download it now
January 10th, 2012 8:44am

Hi Try the script below ---------------------------------------------------------------------------------------- $DGs = Get-DistributionGroup Foreach ($DG in $DGs) { $List = $DG.acceptmessagesonlyfrom $List+="Rajco" $DG | Set-DistributionGroup -AcceptMessagesOnlyFrom $List } ----------------------------------------------------------------------------------------- Cheers Zi Feng
January 12th, 2012 6:32am

Thanks Zi Feng, that script is working exactly what I need.
Free Windows Admin Tool Kit Click here and download it now
January 12th, 2012 10:14am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics