Group Membership Approval – PowerShell Manipulation

Recently I had an issue with a client where they noticed that a couple of groups they were a manager did not look the same in their Outlook client. One would be in bold and he could edit the list and the other was not bolded and he was not able to edit the list. I pulled up the two lists in the Exchange Management Console and discovered on the Membership Approval tab of the groups that one was set to Closed/Closed and the other was set to Owner Approval and Open:
Group-01
Group-02
To fix the group I simply changed the top setting to “Owner approval. Approved by group owners is required.”
Group-03
Then I decided to create a report on these properties for all the groups in the environment. Make sure you run Get-DistributionGroup and not Get-Group as Get-DistributionGroup will give you the attributes you need:
Group-04
Let’s create a report of all distribution groups and list just its name and these membership settings:

Get-distributiongroup -resultsize unlimited |ft name,memberjoinrestriction,memberdepartrestriction

Now, if you use Quest Active Roles Management PowerShell AddIns you can generate a similar report using this command:

Get-qadgroup -resultsize unlimited -includeallproperties |ft name,*canupdate*

Note that there is no get-qaddistributiongroup command, hence the use of get-qadgroup. The use of ‘-includeallproperties’ because the properties you need are not revealed by the base command. You will find this -inlcudedallproperties is a very useful switch when using Quest tools.

Now let’s say you wanted to change all of these groups to be consistently open for both Joining and Departing group membership? Easy:

Get-distributiongroup | set-distributiongroup -memberjoinrestriction:open -memberdepartrestriction:open

** If you look at the options of the set-distributiongroup command, the available values for both properties are open, closed, and ApprovalRequired.
Group-05

Quick reference on what each value will change:
Group-06
Technet Articles
http://technet.microsoft.com/en-us/library/bb124755(v=exchg.141).aspx
http://technet.microsoft.com/en-us/library/bb124955(v=exchg.141).aspx

Related PowerShell Commands
Add-DistributionGroupMember
Disable-DistributionGroup
Enable-DistributionGroup
Get-DistributionGroup
Get-DistributionGroupMember
Get-DynamicDistributionGroup
New-DistributionGroup
New-DynamicDistributionGroup
Remove-DistributionGroup
Remove-DistributionGroupMember
Remove-DynamicDistributionGroup
Set-DistributionGroup
Set-DynamicDistributionGroup

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