One of the very common tasks I find myself doing as I support many of our O365 customers is granting a user access to someone else’ calendar.

When you do it manually, it’s a fairly boring and tedious process– 1) go to the Microsoft Exchange Admin portal and search for the user’s mailbox, 2) grant yourself full access, 3) go to your own mailbox and select “Open Another User’s Mailbox”. 4) Switch to their calendar view, 5) highlight their calendar and select “Sharing and Permissions”. 6) click the + button, 7) type in a user’s name to search for it, 7) select the user from the list and the appropriate permission level and click the share button. This would take about five minutes to complete.

I got sick of doing this so I wrote a small PowerScript script to do to all that for me. Now it takes about 30 seconds.

param(
[string] $SamAccountName,
[Parameter(HelpMessage=”User Name”)] [string] $User,
[string][ValidateSet(‘Owner’, ‘Author’, ‘Reviewer’, ‘None’)] $Rights
)

try {

Add-MailboxFolderPermission -Identity "$($SamAccountName):\calendar"  -user $User -AccessRights $Rights
Write-Output "Granted $Identity the $Rights Permission"

} catch {
Write-Output $_.Exception.Message

}

Category
Tags

No responses yet

Leave a Reply