Manage Folder Permission by using PowerShell | Office 365 5/5 (3)

In the current article, we review the use of the folder permissions PowerShell command in Office 365 and Exchange Online environment.

Technically, the ability to share a specific folder can be implemented for each of the user folders but, most of the time, the need to share a folder is related to the calendar and contact folder.
By using the Folder Sharing, we can enable other users to get access to specific Outlook folders such as Calendar, Contacts, and Tasks.

The “Sharing folder” process, is based on two elements: the user (or group) that we want to share with them the folder, and the level of permission that we want to enable.

For example – by default, users can see only the free/busy time of other recipients.

In case that we want to allow other users to get more information about the meeting, we can change the default permissions, and enable other users to see additional information about the meeting such as meeting Subject and location.

Folder permissions can be assigned by the user himself (by using the Outlook or OWA interface) or by using PowerShell.

The considerable advantage of using PowerShell for managing folder permissions is that – the administrator can remotely create the required setting for the user (assist users and prevent miss configurations) and using the power of the PowerShell, to execute commands in Bulk Mode (execute configuration settings for more than one Mailbox).


Article Table of content | Click to Expand

PowerShell | Help & additional information

In case that you are a novice in the PowerShell environment, you can use the following link to get more information about the “first steps” such as: downloading the required PowerShell
software components, how to use the PowerShell console, running a PowerShell script, etc.

Read more
Link Table
PowerShell Naming Conventions & general information

If you want to get more information about the Naming Conventions that we use for this article and get some general tips about: how to work with the PowerShell, read the article: Help and additional information – o365info.com PowerShell articles

Create remote PowerShell session

Before we can use the required PowerShell commands, we need to download and install the Office 365 cmdlets + create remote PowerShell session to Office 365 or Exchange Online. If you need more information about how to create a remote PowerShell session read the following articles: Part 2: Connect to Office 365 by using Remote PowerShell and Part 3: Connect to Exchange Online by using Remote PowerShell

How to use a PowerShell script

Most of the PowerShell articles include a PowerShell script that simplifies the use of the PowerShell commands. If you want to get more information about: How to use a PowerShell script, read the article: Connect to Office 365 and Exchange Online using a script

PowerShell command and Script languish in more details

If you are new to the PowerShell world, you can read more information about PowerShell in Office 365 environment in the article: The Power of PowerShell

The AccessRights parameter also specifies the permissions for the user with the following roles, which are a combination of the rights listed previously:

  • None FolderVisible
  • Owner CreateItems, ReadItems, CreateSubfolders, FolderOwner, FolderContact, FolderVisible, EditOwnedItems, EditAllItems, DeleteOwnedItems, DeleteAllItems
  • PublishingEditor CreateItems, ReadItems, CreateSubfolders, FolderVisible, EditOwnedItems, EditAllItems, DeleteOwnedItems, DeleteAllItems
  • Editor CreateItems, ReadItems, FolderVisible, EditOwnedItems, EditAllItems, DeleteOwnedItems, DeleteAllItems
  • PublishingAuthor CreateItems, ReadItems, CreateSubfolders, FolderVisible, EditOwnedItems, DeleteOwnedItems
  • Author CreateItems, ReadItems, FolderVisible, EditOwnedItems, DeleteOwnedItems
  • NonEditingAuthor CreateItems, ReadItems, FolderVisible
  • Reviewer ReadItems, FolderVisible
  • Contributor CreateItems, FolderVisible

Folder permissions PowerShell commands basic structure

The basic structure of the PowerShell Folder permissions command, is written by using the following syntax:

Folder permissions PowerShell command basic structure

In our example, we want to enable Alice to have Publishing Editor permission, to hear manager calendar (John).
The -Identity parameter, relates to the user who wants to “share” his calendar (provide other users the option to access the content of his calendar) and the –User parameter, represent the user who will get the access to the calendar.

1. Assign Folder Permission to Calendar folder (Calendar sharing)

1.1 – Assign Publishing Editor Permission to Calendar Folder

PowerShell command Syntax

PowerShell command Example

1.2 – Assign Publishing Editor permissions to specific user to all existing Calendars (Bulk Mode)

PowerShell command Syntax

PowerShell command Example

1.3 – Set the default Folder permission of calendar to: Publishing Editor

PowerShell command Syntax

PowerShell command Example

1.4 – Set the default sharing permission for everyone in your organization to: Reviewer (Bulk Mode)

PowerShell command Syntax

1.5 – Assign Publishing Editor Permission to Calendar folder – Different languish

PowerShell command Syntax

PowerShell command Example

2. Assign Folder permission to Contacts folder

2.1 – Assign Publishing Editor Permission to Contacts Folder

PowerShell command Syntax

PowerShell command Example

2.2 – Set the default permission for Contacts folder to Publishing Editor

PowerShell command Syntax

PowerShell command Example

3. Display Folder permission (Calendar and Contacts)

3.1 – Display calendar Folder permission

PowerShell command Syntax

PowerShell command Example

Adjustments & Customizations: Filter the display output details

PowerShell command Example

3.2 – Display contacts Folder permission

PowerShell command Syntax

PowerShell command Example

Adjustments & Customizations: Filter the display output details

PowerShell command Example

3.3 – Export folder permission for all of the recipients ( Bulk mode) | CSV Format

PowerShell command Syntax

PowerShell command Example

4. Remove folder permissions

4.1 – Remove Permission from a Calendar folder for a specific user

PowerShell command Syntax

PowerShell command Example

Adjustments & Customizations: Remove the prompt for conformation.
PowerShell command Example

4.2 – Remove Permission from a contacts folder for a specific user

PowerShell command Syntax

PowerShell command Example

Adjustments & Customizations: Remove the prompt for conformation.
PowerShell command Example

4.3 – Remove permission for a specific user from all Calendars (Bulk Mode)

PowerShell command Syntax

PowerShell command Example

5. Assign Folder permissions | Advanced

5.1 – Assign Folder Permissions to specific mailbox folder

PowerShell command Syntax

PowerShell command Example

5.2 – Assign Recursive Shared Folder Permissions

PowerShell command Syntax

PowerShell command Example

For your convenience, I have “Wrapped” all the PowerShell commands that were reviewed in a PowerShell Script named:
Folder-Permission.ps1
You are welcome to download the script and use it.

download-button-02.png

PowerShell command syntax – Office 365 | Article series index

Now it’s Your Turn!
It is important for us to know your opinion on this article


Summary
Article Name
Manage Folder Permission by using PowerShell | Office 365
Description
In the current article, we review the use of the folder permissions PowerShell command in Office 365 and Exchange Online environment.Technically, the ability to share a specific folder can be implemented for each of the user folders but, most of the time, the need to share a folder is related to the calendar and contact folder. By using the Folder Sharing, we can enable other users to get access to specific Outlook folders such as Calendar, Contacts and Tasks.
Author
Publisher Name
o365info.com
Publisher Logo

Please rate this

Print Friendly

Related Post

Eyal Doron on EmailEyal Doron on FacebookEyal Doron on GoogleEyal Doron on LinkedinEyal Doron on PinterestEyal Doron on RssEyal Doron on TwitterEyal Doron on WordpressEyal Doron on Youtube
Eyal Doron
Share your knowledge.
It’s a way to achieve immortality.
Dalai Lama

14 Responses to “Manage Folder Permission by using PowerShell | Office 365”

  1. Hello Leon
    The answer is: “Yes” and “No”.
    Technically the PowerShell concepts and logic are the same for all of the Microsoft product such as: Active Directory PowerShell, Exchange 2007, 2010 PowerShell etc. but…
    Office 365 and Exchange online environment include additional or different cmdlets that are relevant only for this environments. You can try to use the PowerShell sample in your Exchange 2007 server, but you probably need to “customize” the syntax for your exchange 2007 environment.

  2. Hi,
    is there a way to removeclear all Permission from for example:
    inboxblabla Folder
    Except the default autor Permission ?

    thanx,
    Nissana

  3. Thanks, this is cleverly done. I’d only found how to do it with get-mailboxfolder -recurse which you can only do if you are the folder’s owner already. I’m using it because I’m not, and I want to be 🙂

  4. Trying to run this, but keep getting unexpected token error (365 2013): foreach($user in Get-Mailbox Get-Mailbox -RecipientTypeDetails UserMailbox) { $cal = $user.alias+”:Calendar” add-MailboxFolderPermission -Identity $cal -User Default -AccessRights Readitems }

  5. Hi, I tried the above it is all working. The only problem is, the user do not see the given rights in the outlook. Example, after running,

    Add-MailboxFolderPermission John:contacts -AccessRight PublishingEditor -User Suzan

    I do not see John’s contacts in Suzan’s outlook. Is there a way to display this in outlook? I tried using outlook client, it works fine. But using powershell it does not come out.

    • As Susan, you will have to go to File / Open another user’s folder / Contacts and open John’s contacts.

      His contacts will not just automatically show up in Susan’s Outlook

    • Susan will not just automatically see John’s contacts in her contact manager. She has the right to see his folder though, so she can go to File / Open & Export / Other User’s Folder and open his contact folder that way.

  6. How can we provide folder permission from On-premises server to exchange online user.
    Ex: User A (SharedMailbox at Onpremise), User B (Office 365), Need to provide folder access permission to User B for User A mailbox folder.

  7. There is a misspelling in these:

    $AllMailboxs = Get-Mailbox -Resultsize Unlimited

    Foreach ($user in $AllMailboxs)

    “Mailboxes”, not “Mailboxs”

    • Kevin: $AllMailboxs is just a variable name. It works fine as long as you misspell it in both places!

      New question: Is there a command that will affect mailboxes that haven’t been created yet? For example, we want the Office Manager to have edit rights to every user’s contacts. These commands let me do that for all existing mailboxes, but if we hire someone tomorrow I’d have to remember to run the script for the new user.

Leave a Reply

Your email address will not be published. Required fields are marked *