Mailbox Folder permission on all folders and subfolders

Hello Team,

Can you please guide me how to give MailboxFolderpermission on folder and thier subfolders in one go to one user with accessrights suppose we take Owner.

Thanks,
andy
LVL 5
Addy NadiaExpertAsked:
Who is Participating?

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

x
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.

AmitIT ArchitectCommented:
You can give full mailbox permission. That will automatically provide permission on all Folders.
Addy NadiaExpertAuthor Commented:
this is not i am looking for.. i need in inbox, only particular scripts sub-folder can take permissions
i am using below command, which is working fine. i need it read only one particular folder in inbox and give permission to user on all subfolders in it..

ForEach($f in (Get-MailboxFolderStatistics "ngupta2" | Where { $_.FolderPath.Contains("/Inbox") -eq $True } ) ) { $fname = "ngupta2:" + $f.FolderPath.Replace("/","\"); Add-MailboxFolderPermission $fname -User "vchiu" -AccessRights Reviewer }
Addy NadiaExpertAuthor Commented:
in inbox there is one subfolder and in that sub folder there are many subfolder.
so i need. it skip the inbox and give the necessary permissions to subfolder that i want.. if this get succedd. then the subfolder that having many subfolders it will automatically came
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

FOXActive Directory/Exchange EngineerCommented:
Andi,
Explain to me what you are trying to do exactly and i will give you the correct command.  Does  userx need full permissions on usery's mailbox?
FOXActive Directory/Exchange EngineerCommented:
Add-MailboxFolderPermission -Identity emailaddressofthemailboxbeingaccessed:\NameofFolderyouneedtoaccess -User emailaddressofuseraccessing -AccessRights Owner
Addy NadiaExpertAuthor Commented:
Hello Foxluv,

I will give you the Example.. Suppose i have parent folder Inbox ..OK... and in INBOX-->Test....OK
and Test having further sub folders

Now i want user X can have permission on user y mailbox on Test Folder and thier subfolders.... not all the folders in Inbox.... only Test and subfolders in it.

i run the command for inbox only and it is working perfectly fine.. and it giving permission to all subfolders in it... But my question in 1st paragraph is little different.

Hope this clarify you, i use below command.. i am not script master..so need help in this.

ForEach($f in (Get-MailboxFolderStatistics "userx" | Where { $_.FolderPath.Contains("/Inbox") -eq $True } ) ) { $fname = "userx:" + $f.FolderPath.Replace("/","\"); Add-MailboxFolderPermission $fname -User "usery" -AccessRights Reviewer }
FOXActive Directory/Exchange EngineerCommented:
Very well you  can use the command I left you above.

Add-MailboxFolderPermission -Identity usery@domain.com:\Test -User userx@domain.com -AccessRights Reviewer
Addy NadiaExpertAuthor Commented:
your is normal command.. this is somethign tricky one.. please see my comment
Will SzymkowskiSenior Solution ArchitectCommented:
I think you are making this more complex then it needs to be. I beleive that I also provided an answer on another question as well regarding this. However you can do this using the syntax below....

For a single mailbox
Get-MailboxFolder -Identity user1:\inbox -recurse | add-mailboxFolderPermission -User user2 -AccessRights owner

Open in new window


For muultiple users
$User = "Administrator"
$Mailboxes = Get-Mailbox -ResultSize "unlimited"

ForEach ($Mailbox in $Mailboxes) 
    {
        
        Get-MailboxFolder -Identity $Mailbox":\Inbox" -recurse | add-mailboxFolderPermission -User $User -AccessRights owner
        
}

Open in new window


That should be all that is required.

Will.
FOXActive Directory/Exchange EngineerCommented:
Andi, this is a very simple basic command which I have supplied you.  Is this command necessary for one user or do you need many users to have access to the subfolder?
Will SzymkowskiSenior Solution ArchitectCommented:
The way to accomplish this is by using the Get-MailboxFolder -Recurse switch and PIPING it to ADD-MAILBOXFOLDERPERMISSION which will get all of the subfolders under INOBX. it will then add the permissions to each folder. I have just tested this exact scenario in my lab and it works without any issue. I have used my exact script i have provided above.

Will.
FOXActive Directory/Exchange EngineerCommented:
Andi,
You can use Will's script but being that you don't need the inbox put the name of your subfolder after the backslash in his script

:\NameofSubfolder
Addy NadiaExpertAuthor Commented:
Hello Will,

Get folder is not working on power shell.. your command is good yesterday that i asked in another question.

But here i asked somethign different... i dont need inbox.. i need the subfolder of it.

Please see my command in above comments.
i am just not able to make it as a subfolder instead of Inbox.

Hope this clarifies for both expert

Thanks,
Andy
Addy NadiaExpertAuthor Commented:
Get mailbox folder is not working.. normally.. it showing mailbox does not exist.. but i can see all folders of mine.. when i run Get-Mailboxfolder command

Dont know,, if this is something due to any RBAC

Thanks
FOXActive Directory/Exchange EngineerCommented:
Are you doing this in Exchange Management shell and do you have the proper permissions?
Addy NadiaExpertAuthor Commented:
hello fox

I run below command ..it did not run successfully

Get-MailboxFolder -Identity ngupta2:\scripts -recurse | add-mailboxFolderPermission -User vchiu -AccessRights owner

scripts is the subfolder in inbox
Addy NadiaExpertAuthor Commented:
i am using windows powershel.. i am having rights..
i am in exchange 2013 environment
FOXActive Directory/Exchange EngineerCommented:
Are you in the exchange management shell or just regular windows powershell?
FOXActive Directory/Exchange EngineerCommented:
I want you to run the command Get-excommand and let me know if you get a list of exchange commands.
Addy NadiaExpertAuthor Commented:
it is showing unrecognized commmand......
FOXActive Directory/Exchange EngineerCommented:
That's what I thought.  You need to run the command from exchange management shell
FOXActive Directory/Exchange EngineerCommented:
If it isn't installed on that machine you can run the exchange install cd and just install the management tools, that will install the exchange management console and the exchange management shell on that machine you are using.
Addy NadiaExpertAuthor Commented:
i think you are not getting me.. there is no Exchange 2010 in my environment.. it is only Exchaneg 2013
and i usually do all administrative task using Windows Power shell.
Will SzymkowskiSenior Solution ArchitectCommented:
Hopefully this works for you and we are all on the same page here...

$User = "Administrator"
$Mailboxes = Get-Mailbox -ResultSize "unlimited"

ForEach ($Mailbox in $Mailboxes) 
    {
        
        Get-MailboxFolder -Identity $Mailbox":\Inbox\WhateverSubFolder" -recurse | add-mailboxFolderPermission -User $User -AccessRights owner
        
}

Open in new window


I have modified my original script. it should be \inbox\whateverSubFolder and use the -recurse switch to get all of the folders under the "WhateverSubFolder" you have specified.

Will.
Addy NadiaExpertAuthor Commented:
in this where i need to mentioned identity user and user on which permission need to be applied
Addy NadiaExpertAuthor Commented:
Will, please help..w e are very near to resolution

I really appreciate your efforts in this.. i really need to accept the solution...i need closing comments now..

thank you

thanks,
Andy
Addy NadiaExpertAuthor Commented:
Will,

Can you please update the thread
Will SzymkowskiSenior Solution ArchitectCommented:
Andy,

I am not sure what more you are looking for?

Please let me know.

Will.
Addy NadiaExpertAuthor Commented:
in your last update. where i need to mention the user i want to give permission and to which user it would be get assigned
Will SzymkowskiSenior Solution ArchitectCommented:
So the $User variable in my script is set to Administrator. If you are only looking to do this for 1 mailbox then use the following script below...

$User = "Administrator"
$Mailbox = "User1"
Get-MailboxFolder -Identity $Mailbox":\Inbox\WhateverSubFolder" -recurse | add-mailboxFolderPermission -User $User -AccessRights owner
        
}

Open in new window


Will.

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
Addy NadiaExpertAuthor Commented:
Will, You are Superrrr ...

It works like a Charm !!

Thanks you so much for all your support.... How can i specially request my questions to you.. Because what i see.. i get Response from Engineers very slow..

You are Really Awsum !!

Thanks,
Andy
Addy NadiaExpertAuthor Commented:
I want to give Speciall thanks to Will.
His work is Really commendable.. Every time he comment.. he gives one linner solution not moving his cursor here n there..

If i would get this kind of support from Experts-exchange.. I would be happy registered by myself for more years.. Even i am recommending for this Site to other users as well.. !!

Because I am Happy

Thnx
Will SzymkowskiSenior Solution ArchitectCommented:
Thank you for that appreciate it <3 follow and support!

Will.
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
Exchange

From novice to tech pro — start learning today.