Answered by:
Remove a User from all the Distribution Group

Question
-
How Do I remove a particular user from all the DG in the Rxchange 2007 Organization.
thanks
Tuesday, September 13, 2011 3:55 PM
Answers
-
Powershell or remove it from ADUC.
$DGs= Get-DistributionGroup | where { (Get-DistributionGroupMember $_ | foreach {$_.PrimarySmtpAddress}) -contains "user@domain.com" }
foreach( $dg in $DGs){
Remove-DistributionGroupMember $dg -Member user@domain.com
}
Powershell-Script to remove all group memberships for one user
James Chong MCITP | EA | EMA; MCSE | M+, S+ Security+, Project+, ITIL msexchangetips.blogspot.com- Marked as answer by Gavin-Zhang Wednesday, September 14, 2011 10:05 AM
Tuesday, September 13, 2011 4:10 PM
All replies
-
Powershell or remove it from ADUC.
$DGs= Get-DistributionGroup | where { (Get-DistributionGroupMember $_ | foreach {$_.PrimarySmtpAddress}) -contains "user@domain.com" }
foreach( $dg in $DGs){
Remove-DistributionGroupMember $dg -Member user@domain.com
}
Powershell-Script to remove all group memberships for one user
James Chong MCITP | EA | EMA; MCSE | M+, S+ Security+, Project+, ITIL msexchangetips.blogspot.com- Marked as answer by Gavin-Zhang Wednesday, September 14, 2011 10:05 AM
Tuesday, September 13, 2011 4:10 PM -
Hi Viministrator,
Above gave a good solution.
If you still have other issue, you could reopen the thread.
Regards!
GavinTechNet Subscriber Support in forum
If you have any feedback on our support, please contact tngfb@microsoft.com
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.Wednesday, September 14, 2011 10:06 AM -
Hey Guys,
I'm new to Power SHell. I'm wondering is there any shell script to remove a user from a particular DG
Appreciate for your assistance.
Thank
Tuesday, April 18, 2017 4:42 PM