locked
permission RRS feed

  • Question

  • Hi experts, 
    i am using exchange 2010 hybrid environment, i am able to add users to shared mailbox on cloud using the below syntax.
    i have to add 50 users to this shared mailbox and i have the users in csv file in the below format, please help me with the syntax to add users.

    Users
    james@mycomp.com
    Roger@mycomp.com

    Add-MailboxPermission -Identity "Cloud Shared Mailbox" -User mary@mycomp.com -AccessRights FullAccess -InheritanceType All -AutoMapping $True
    Remove-MailboxPermission -Identity "Cloud Shared Mailbox" -User mary@mycomp.com -AccessRights FullAccess


    Add-RecipientPermission "Cloud Shared Mailbox" -AccessRights SendAs -Trustee "mary@mycomp.com"
    Remove-RecipientPermission "Cloud Shared Mailbox" -AccessRights SendAs -Trustee "mary@mycomp.com"
    • Edited by ItsMe-Roger Thursday, December 19, 2019 5:02 AM h
    Thursday, December 19, 2019 5:01 AM

Answers

  • Yes, the above syntax would work but before that you need to make sure to import those users from csv else it would be a manual effort. so you can use something like this..

    $Users = Import-Csv "c:\temp\inf.csv"

    foreach($User in $Users){Add-MailboxPermission -Identity "Cloud Shared Mailbox" -User $user.User -AccessRights FullAccess -InheritanceType All -AutoMapping $True}

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered"Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    • Proposed as answer by Josh Bines Monday, December 30, 2019 2:04 PM
    • Marked as answer by ItsMe-Roger Tuesday, January 7, 2020 12:19 PM
    Thursday, December 26, 2019 11:51 AM
  • Hi,

    When add "full access" permission, you need to use "Add-MailboxPermission" command.

    When add "send as" permission, you need to use "Add-RecipientPermission" command.

    So, you should prepare two source files, one of them contained mailboxes that you want to add full access, the other one contained mailboxes that you want to add send as permission.

    Then you should use two script to add permission for them:

    $Users = Import-Csv "c:\temp\fullAccess.csv"
    
    foreach($User in $Users){
        Add-MailboxPermission -Identity "Cloud Shared Mailbox" -User $user.name -AccessRights FullAccess
    }
    $Users = Import-Csv "c:\temp\sendAs.csv"
    
    foreach($User in $Users){
        Add-RecipientPermission "Cloud Shared Mailbox" -AccessRights SendAs -Trustee $user.name
    }

    Regards,

    Kyle Xu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    • Marked as answer by ItsMe-Roger Tuesday, January 7, 2020 12:18 PM
    Tuesday, January 7, 2020 8:25 AM

All replies

  • Yes, the above syntax would work but before that you need to make sure to import those users from csv else it would be a manual effort. so you can use something like this..

    $Users = Import-Csv "c:\temp\inf.csv"

    foreach($User in $Users){Add-MailboxPermission -Identity "Cloud Shared Mailbox" -User $user.User -AccessRights FullAccess -InheritanceType All -AutoMapping $True}

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered"Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    • Proposed as answer by Josh Bines Monday, December 30, 2019 2:04 PM
    • Marked as answer by ItsMe-Roger Tuesday, January 7, 2020 12:19 PM
    Thursday, December 26, 2019 11:51 AM
  • Hi,

    When add "full access" permission, you need to use "Add-MailboxPermission" command.

    When add "send as" permission, you need to use "Add-RecipientPermission" command.

    So, you should prepare two source files, one of them contained mailboxes that you want to add full access, the other one contained mailboxes that you want to add send as permission.

    Then you should use two script to add permission for them:

    $Users = Import-Csv "c:\temp\fullAccess.csv"
    
    foreach($User in $Users){
        Add-MailboxPermission -Identity "Cloud Shared Mailbox" -User $user.name -AccessRights FullAccess
    }
    $Users = Import-Csv "c:\temp\sendAs.csv"
    
    foreach($User in $Users){
        Add-RecipientPermission "Cloud Shared Mailbox" -AccessRights SendAs -Trustee $user.name
    }

    Regards,

    Kyle Xu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    • Marked as answer by ItsMe-Roger Tuesday, January 7, 2020 12:18 PM
    Tuesday, January 7, 2020 8:25 AM