Forum Discussion
Russ Mckee
Feb 12, 2018Copper Contributor
Report on Default Calendar Permissions if they are set to AvailabilityOnly
Hi All,
I have a daily script running against Office 365 to set the permissions of all mailbox calendars to be "Reviewer" for all (being the Default user). This script works well, however what I am trying to do is get an exception report from PowerShell to list all the mailboxes that doesn't have the correct Default permission of Reviewer. Thus generating an exception list to investigate why.
This script gets me the list:
$users = Get-Mailbox -Resultsize Unlimited
foreach ($user in $users) {
Get-MailboxFolderPermission -Identity "$($user.alias):\calendar" | where {$_.User -like “Default” -and ($_.AccessRights -like “AvailabilityOnly”)}
}
But the output is this:
FolderName User AccessRights SharingPermissionFlags
FolderName
---------- ---- ------------ ----------------------
Calendar Default {AvailabilityOnly}
Calendar Default {AvailabilityOnly}
Calendar Default {AvailabilityOnly}
Calendar Default {AvailabilityOnly}
Calendar Default {AvailabilityOnly}
Calendar Default {AvailabilityOnly}
When I want to get a list of users that are exceptions out to a file. Therefore the helpdesk recipient knows there is an exception to investigate.
Can someone Help?
2 Replies
Sort By
- Russ MckeeCopper Contributor
I found the solution:
$users = Get-Mailbox -Resultsize Unlimited
foreach ($user in $users) {
Get-MailboxFolderPermission -Identity "$($user.alias):\calendar" | where {$_.User -like “Default” -and ($_.AccessRights -notlike “Reviewer”)} | FL Identity | Out-File -append "C:\Scripts\Logs\UsersWithoutDefaultReviewerInCalendar.txt"
}
You can do it even easier by using the -User parameter:
Get-MailboxFolderPermission huku:\Calendar -User Default