Share Folder

Glenn Maxwell 11,316 Reputation points
2022-04-02T12:20:28.473+00:00

Hi All

i am using exchange 2016 hybrid environment, we create users in onprem and migrate them to online. i have a user lets say user1@Company portal .com and he want to share couple of outlook folders to user2.

Lets say Folder is Project1 , user1 want to share it to user2. is the below syntax correct.

ForEach($Q in (Get-MailboxFolderStatistics user1@contoso.com | Where { $_.FolderPath.Contains("Project1") -eq $True } ) ) {  
Add-MailboxFolderPermission user1@contoso.com -User user2@contoso.com -AccessRights Editor }  

user1 has a folder Project2 and it has subfolders, user1 want to share this folder and all its subfolders to user2.is the below syntax correct.

ForEach($Q in (Get-MailboxFolderStatistics user1@contoso.com | Where { $_.FolderPath.Contains("Project2") -eq $True } ) ) {  
$usr = "user1@contoso.com:" + $f.FolderPath.Replace("/","\");  
Add-MailboxFolderPermission $usr -User user2@contoso.com -AccessRights Editor }  
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,529 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,632 questions
0 comments No comments
{count} votes

Accepted answer
  1. Kael Yao-MSFT 37,646 Reputation points Microsoft Vendor
    2022-04-04T08:18:45.193+00:00

    Hi @Glenn Maxwell

    Scenario 1 (I suppose you mean a single folder):
    Would the following cmdlets work for you in this scenario?

    Add-MailboxFolderPermission user1@contoso.com -User user2@contoso.com -AccessRights Reviewer  
      
    Add-MailboxFolderPermission user1@contoso.com:\Project1 -User user2@contoso.com -AccessRights Editor  
    

    Scenario 2 (I suppose you mean the main folder and its sub-folders)

    Add-MailboxFolderPermission user1@contoso.com -User user2@contoso.com -AccessRights Reviewer  
    $folders = Get-MailboxFolderStatistics user1@contoso.com | Where { $_.FolderPath.Contains("Project1") -eq $True }  
    Foreach($folder in $folders)  
    {  
    $path = "user01@contoso.com:" + $folder.folderpath.Replace("/","\")  
    Add-MailboxFolderPermission $path -User user2@contoso.com -AccessRights Editor  
    }  
    

    It would also give Editor permissions of the sub-folders of Project2 to user2.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.