Hi All,
Recently we have a requirement to get the report on permissions for all Room mailboxes calendar.
We want to know who has the permissions to book the rooms directly. This script is also a good example of switch case 🙂
You can also modify the code line below at the beginning of the script if you want to extract Calendar permissions for other mailbox types.
$rooms = get-mailbox -RecipientTypeDetails roommailbox -resultsize unlimited
Report should be of below format:
Just extract the script from below link, Launch Exchange 2010 management shell & execute it.
https://github.com/VikasSukhija/Downloads/blob/master/ConfRoomCalendarPermissions.zip
Here is how you will see the script execution on screen :
Below is the csv report that will get created inside same folder from whcih script has been executed.
Prerequisite: Exchange 2010 management Shell
############################################################################## # Author: AMit Mittal # Reviewer: Vikas Sukhija # Date: 08/10/2015 # Modified: 08/19/2015 # Desc: get access details on Calenadr confrernce rooms ############################################################################## $ConPermission = @() $rooms = get-mailbox -RecipientTypeDetails roommailbox -resultsize unlimited Foreach ($Mailbox in $rooms) { $perm = Get-mailboxfolderpermission -identity ($Mailbox.alias+':\calendar') $userN = $null $userC = $null $userA = $null $userPA = $null $userNEA = $null $userR = $null $userE = $null $userPE = $null $userO = $null $userAO = $null $userL = $null foreach ($acc in $perm){ $user = $null $user = $acc.user $user = $user.ToString() $access = $acc.accessrights Switch($access){ None { $userN += $user + ","} Contributor { $userC += $user + ","} author { $userA += $user + ","} PublishingAuthor { $userPA += $user + ","} NonEditingAuthor { $userNEA += $user + ","} Reviewer { $userR += $user + ","} Editor { $userE += $user + ","} PublishingEditor { $userPE += $user + ","} Owner { $userO += $user + ","} Availabilityonly { $userAO += $user + ","} Limiteddetails { $userL += $user + ","} default {"Something else happened"} } } $roomp = "" | select ConfRoomname,None,Contributor,author,PublishingAuthor,NonEditingAuthor,Reviewer,Editor,PublishingEditor,Owner,Availabilityonly,Limiteddetails $roomp.ConfRoomname = $Mailbox.displayname $roomp.None = $userN $roomp.Contributor = $userC $roomp.author = $userA $roomp.PublishingAuthor = $userPA $roomp.NonEditingAuthor = $userNEA $roomp.Reviewer = $userR $roomp.Editor = $userE $roomp.PublishingEditor = $userPE $roomp.Owner = $userO $roomp.Availabilityonly = $userAO $roomp.Limiteddetails = $userL $ConPermission += $roomp } $ConPermission | export-csv .\ConfPermissions.csv -notypeinformation ######################################################################################