Forum Discussion
Calendar permissions
- Sep 23, 2019
This is what worked from me, after some tweaking
$Report = ForEach ($Mailbox in (Get-Mailbox -ResultSize Unlimited -RecipientType UserMailbox | Where-Object {($_.WindowsEmailAddress -like '*@"insert_domain_name"*')}))
{ Get-MailboxFolderPermission -Identity "$($Mailbox.Name):\Calendar" | Select @{n='Mailbox';e={$Mailbox.Name}},User,AccessRights}
out-file -filepath C:\Export.txt -inputobject $report
this should work:-
$mailboxes=Get-Mailbox|?{$_.PrimarySMTPAddress -match "@contoso.com"}
foreach ($mailbox in $mailboxes)
{
$SMTP=$mailbox.PrimarySMTPAddress
$calendar=$SMTP+":\Calendar"
Get-MailboxFolderPermission $calendar -User Ayla@contoso.com
}
- DiVojichSep 13, 2019Brass Contributor
Hi,
a couple of questions...where should I put "ResultSize -Unlimited", I presume in Get-Mailbox 1st line?
Why is for user saying "Deafult" & not giving me names of actual users?
Also, calendar does not show the identities to the which the permissions apply....
Kind regards,
- DeepakRandhawaSep 13, 2019Iron Contributoryou are correct "ResultSize -Unlimited" goes here
$mailboxes=Get-Mailbox -ResultSize Unlimited |?{$_.PrimarySMTPAddress -match "@contoso.com"}
For all permissions on a calendar simply remove "-User Ayla@contoso.com" part of the command.- DiVojichSep 23, 2019Brass Contributor
This is what worked from me, after some tweaking
$Report = ForEach ($Mailbox in (Get-Mailbox -ResultSize Unlimited -RecipientType UserMailbox | Where-Object {($_.WindowsEmailAddress -like '*@"insert_domain_name"*')}))
{ Get-MailboxFolderPermission -Identity "$($Mailbox.Name):\Calendar" | Select @{n='Mailbox';e={$Mailbox.Name}},User,AccessRights}
out-file -filepath C:\Export.txt -inputobject $report
- ClaudioCerchiaSep 13, 2019Copper Contributor
HiDiVojich
please have a look again at the documentation for the cmdlets of Get-Mailbox (https://docs.microsoft.com/en-us/powershell/module/exchange/mailboxes/get-mailbox?view=exchange-ps#examples) and Get-MailboxFolderPermission (https://docs.microsoft.com/en-us/powershell/module/exchange/mailboxes/get-mailboxfolderpermission?view=exchange-ps).
If you want to get all mailboxes in your organization, you need to use the following code:
Get-Mailbox -ResultSize unlimited
If you want to get the calendar permission of each mailbox use the following:
Get-Mailbox -ResultSize unlimited | % {Get-MailboxFolderPermission -Identity ($_.alias + ":\Calendar") | select User,Foldername,AccessRight
- Kevin_MorganSep 13, 2019Iron Contributor
You have to use "-ResultSize Unlimited" with Get-Mailbox cmdlet
Get-Mailbox -ResultSize Unlimited
You have to exclude the parameter "-User Default" to list all user permissions in John's mailbox. If you provide "-User" parameter, then the command list only permission entries for the specific user in John's mailbox. The below command list all users who has permission in John's mailbox calendar.
Get-MailboxFolderPermission -Identity john@contoso.com:\Calendar
The below command lists all users permission entries in all users mailbox calendar.
Get-Mailbox -ResultSize Unlimited | ForEach {Get-MailboxFolderPermission -Identity "$($_.PrimarySMTPAddress):\Calendar" } | Select Identity,User,AccessRights
You can exclude the "Default" & "Anonymous" entries with Where-Object filter
Get-Mailbox -ResultSize Unlimited | ForEach {Get-MailboxFolderPermission -Identity "$($_.PrimarySMTPAddress):\Calendar" } | Where-Object {$_.User.DisplayName -ne "Default" -and $_.User.DisplayName -ne "Anonymous"} | Select Identity,User,AccessRights