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

hello

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
cawasakiAsked:
Who is Participating?
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 (
    [Parameter(Mandatory=$true,Position=0)][String]$DistributionGroup,
    [Parameter(Mandatory=$true,Position=1)][String]$PublicFolder
)

$users = Get-DistributionGroupMember $DistributionGroup
foreach ($user in $users) {
    Add-PublicFolderClientPermission -Identity "$PublicFolder" -User $user.name -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 sales@domain.com 'Public Folder Root'
0

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:
hello

thanks i will test
0
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
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

cawasakiAuthor Commented:
hello

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:

group1
    user1
    user2
    user3
    group2
        user4
        user5
......

thanks for help
0
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
0
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
0
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.
0
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
0
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
0
cawasakiAuthor Commented:
thanks
0
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
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.