script to get all member of group and set CreateItems right on public folder named TEST2015


i have exchange 2013 and i need script to get all member of group and set CreateItems right for all user on public folder named TEST2015.

the script must get all user members of group named GROUP2015, in this gorup, i have users and other group on it, so script must get users from this group too.

thanks for help
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jason CrawfordTransport NinjaCommented:
I don't currently have the luxury of a sandbox configured with Public Folders so I have not tested this script.  Should get you going in the right direction though:

Param (

$users = Get-DistributionGroupMember $DistributionGroup
foreach ($user in $users) {
    Add-PublicFolderClientPermission -Identity "$PublicFolder" -User $ -AccessRights CreateItems -WhatIf

Open in new window

Because I wasn't able to fully test this script I wrote in a -WhatIf at the end so be sure to remove that prior to running live.  Save the file as whatever...let's call it Add-PFPermsFromDG.ps1.  Here's how you'd run it:

1. Change the working directory of EMS to the parent folder of the Add-PFPermsFromDG.ps1 file
2. Run the script as such:

Add-PFPermsFromDG.ps1 'Public Folder Root'

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cawasakiAuthor Commented:

thanks i will test
Jason CrawfordTransport NinjaCommented:
Woops I missed the part of your question where you provided the PF and DG names.  Here's what it should look like in EMS:

Add-PFPermsFromDG.ps1 GROUP2015 TEST2015

Also - don't forget to set the ExecutionPolicy if you haven't already or else the script won't even try to run:

1. Start either Powershell or EMS as administrator and run this:

Set-ExecutionPolicy -ExecutionPolicy unrestricted -Confirm:$false
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

cawasakiAuthor Commented:

the script work but if the group contain 10 user and one group with 2 user, it add the public folder right for the 10 user and for the group.

i need the script to add the user member for the group and for sub group.

for exemple:


thanks for help
Jason CrawfordTransport NinjaCommented:
You're right...I did not account for nested groups.  

Wait can't you just add the permissions directly to the group?

Add-PublicFolderClientPermission -Identity TEST2015 -User GROUP2015
cawasakiAuthor Commented:
no because on exchange 2013 the group must be enabled email, and the group i need to add is not enabled email only a security group
Jason CrawfordTransport NinjaCommented:
So just mail enable it.  It won't change any access, and if you're worried about email being delivered to the group just keep it at the default for -RequireSmtpAuthentication $true, configure a $null list for -AcceptMessagesOnlyFromSendersOrMembers, and hide it from the GAL.
cawasakiAuthor Commented:
yes i know but i need to do it good, because if i do that for every public folder i will mail enbaled all group :)  so no problem i will try to find a solution
cawasakiAuthor Commented:
i think i need 2 script, first one get all user from the security group

and second script add the permisison of every user to public folder
cawasakiAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.