locked
Excluding Mailboxes When Changing Calendar Permissions via EMS RRS feed

  • Question

  • G'day

    I have to set the default sharing policy for the exchange 2010 server to LimitedDetails but need to exclude a subset of the staff in a certain OU or Security Group.

    I have this script to update ALL calendar accounts but don't know how to do the exclusion.

    $allmailbox=get-mailbox
    
    Foreach ($item in $allmailbox){
    
    Set-mailboxfolderpermission –identity ($item.alias+’:\calendar’) –user Default –Accessrights LimitedDetails
    
    }

    I am not getting very far with the -filter command so am a little stuck. I really don't want to be manually updating all 200 odd accounts on our exchange.

    Any assistance would be greatly appreciated. 

    Cheers

    Pete

    Wednesday, February 26, 2014 5:58 AM

Answers

  • You could start out by setting the allmailbox variable to focus on just a specific OU, such as Sales, for example

    $allmailbox=get-mailbox -OrganizationalUnit OUGroupName

    or, if you want to use the Filter switch, you could try something like this:

    $allmailbox=get-mailbox -Filter {Office -eq 'Finance'}

    or -Filter {Department -eq 'Accounting'}

    or -Filter {CustomAttribute15 -ne 'Exclusion'}


    Wednesday, February 26, 2014 12:14 PM

All replies

  • You could start out by setting the allmailbox variable to focus on just a specific OU, such as Sales, for example

    $allmailbox=get-mailbox -OrganizationalUnit OUGroupName

    or, if you want to use the Filter switch, you could try something like this:

    $allmailbox=get-mailbox -Filter {Office -eq 'Finance'}

    or -Filter {Department -eq 'Accounting'}

    or -Filter {CustomAttribute15 -ne 'Exclusion'}


    Wednesday, February 26, 2014 12:14 PM
  • Hi Pete,

    You can run the script in your original posting to change all mailboxes default sharing permission to LimitedDetails. Then run the following commands to change the excluded security groups permission to what you want.

    $Group=Get-DistributionGroupMember -Identity Group1

    $Group | ForEach{Set-MailboxFolderPermission -Identity “$($_.Name):\Calendar” -User Default -AccessRights None}

    Hope it works.

    Thanks,


    Winnie Liang
    TechNet Community Support


    Thursday, February 27, 2014 9:53 AM
    Moderator