Share This Post

PowerShell cmdlets to work with Distribution group in Exchange 2007–Be careful the difference between AD and Exchange

Here are a few cmdlets to work with distribution group in exchange 2007

New-DistributionGroup – Creates a new distribution group

Set-DistributionGroup – Set Properties on a distribution group

Get-DistributionGroup – Retrieves properties of a distribution group

Remove-DistributionGroup – Deletes a distribution group

If you want to work with DynamicDistributionGroup, just replace DistributionGroup with DynamicDistributionGroup.

As always you can get details by get-help cmdlet -full

How you add member(s) to an existing distribution group?

Add-DistributionGroupMember -Id ITOps -Member ‘yli’

What if you want to grant someone manage a distributiongroup membership permission?

Set-DistributionGroup -id ITOps -ManagedBy ‘Yli’

That actually doesn’t work. It is the same as you use Set-Mailbox cmdlet to set Exchange specific properties and the Set-User cmdlet to set basic Active Directory properties, Here you need to use Set-Group because this action creates a link to another AD account who will manage the group! So the below cmdlet will accomplish the above task!

Set-Group -id ITOps – ManagedBy ‘yli’

I will add a bonus here – what if you change your mind and want to remove someone the manage distributiongroup permission?

Set-Group -id ITOps – ManagedBy $null

Share This Post

Ying Li obtained a Master degree of Medicine in China and worked in the medical field before he came to the states in 1996. He made the career switch from troubleshooting people to troubleshooting computers after he came to the states. Not entirely a surprise there, if you know that his second preference for college is Mathematics. Ying is two times Admin Framework MVP awardee (2007-2008).His previous employment experience in the US includes UUNET, MCI WorldCom. MMC (Marsh & McLennan Companies), Merrill Lynch. He is currently employed by Related Companies as a Senior Infrastructure Engineer. He is proficient in virtually all Microsoft products (Office/Back office). His craving for efficiency naturally leads him to scripting, automation and before you know it, PowerShell! He is currently a MCSE (NT4, 2000, 2003) and MCITP Server Administrator. Ying enjoys wines and love to travel. His non work related passion is to advocate Health Living!

Leave a Reply