Set Author permissions on mailboxes

Roostersync will need an account on your local Exchange environment to sync the schedule. With this script you can set those permissions really easy.

#####################################
# Roostersync set author rights     #
#                                   #
# Smartersoft 2017                  #
# https://roostersync.nl/           #
#####################################

# Requirements:
# - Active Directory PowerShell module
# - Exchange shell
# - AD Group with users
# - Roostersync domain account with mailbox
# - This script needs to be run as an Exchange Admin

# Step 1: Change parameters

# $group needs to be the CN of the group that contains the users to set the rights for.
$group = "CN_of_the_group"

# $authorAccount is the account that will be set as Author on all mailboxes.
$authorAccount = "domain\Roostersync"

# Step 2 (if you don't have the powershell module installed)
# Install Active Directory Powershell

# Import-Module ServerManager
# Add-WindowsFeature RSAT-AD-PowerShell

# Step 3 (if you didn't start the Exchange Management Shell)
# Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn;

# Step 4: The actual script 
# Get all users from AD Group, select their DN, Query exchange for their PrimarySmtpAddress
# Go through all users and set the MailBoxFolderPermission on their calendar.

$users = @(Get-ADGroupMember $group | select - ExpandProperty DistinguishedName | Get-Recipient | select -ExpandProperty PrimarySmtpAddress)
foreach ($user in $users) {

  # Set the permissions if the user choose 'EN'
  Add-MailBoxFolderPermission -identity "${user}:\calendar" -user "$authorAccount" -AccessRights Author

  # Set the permissions if the user choose 'NL' (Why not use a label Microsoft??)
  Add-MailBoxFolderPermission -identity "${user}:\agenda" -user "$authorAccount" -AccessRights Author
}

This script is used the grant a special account rights to all the mailboxes, so it can be used by one of our products.

Roostersync cloud Roostersync on-premise