Creating Restricted Distribution Groups in Exchange Labs using PowerShell

A customer asked me the other day about creating restricted distribution groups in Exchange Labs.  They wanted to create a mailing group for their student council and set not only who managed the group for making membership changes and the like, but also controlling who could mail to the group as they did not want just any old Joe Blow sending messages to it.

This can all be done manually through the Outlook Web Access UI, but if you want to put a process in place for creating groups like this en masse, or you are simply a scripting junkie and don’t like GUIs for anything much, you may also want to consider the PowerShell route… both of which I cover in the recording attached to this post.

You can find a useful Technet article on the manual method here.  For PowerShell, you can see how to create groups here, and modify their properties here.

Double-Click to view in full screen.

http://silverlight.services.live.com/invoke/71782/CreateaRestrictedDistributionGroup_2/iframe.html

 Download

For those of you that simply want the commands I use in my demo, here they are:

:Connect to Exchange Labs Runspace
1. $LiveCred = Get-Credential
2. $rs = New-Runspace -Shell Microsoft.Exchange -ConnectionUri
https://ps.exchangelabs.com/powershell/ -Credential $LiveCred  -Authentication Basic
3. push-runspace $rs

:Create a new Distribution Group
4. New-DistributionGroup -Name "Student Council" -Alias stucncl -DisplayName "Student Council" -Type Distribution

:Set the group restrictions
5. Set-DistributionGroup -Identity stucncl -AcceptMessagesOnlyFrom billg -ManagedBy billg

:Gracefully exit runspace
6. pop-runspace
7. Remove-Runspace $rs

Enjoy!

Jonny

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: