Answered by:
Add calendar shares to all office 365 user subscriptions

Question
-
I am working on setting up all our Office 365 Midsize Business subscription user calendars to be shared / viewable by everyone else. I have 61 users and everyone will be able to see the calendars of the other users. I have a suggested PowerShell script that would add the permission Reviewer for the calendar for each of our "subscription" users:
foreach($user in (Get-Mailbox -RecipientTypeDetails UserMailbox)) {
$cal = $user.alias+":\Calendar"
Add-MailboxFolderPermission -Identity $cal -User viewer@domain.com -AccessRights reviewer
}
I have to change viewer@domain.com for each user account I need to add the permission. Is t here n easier way to go through all my "subscription" user lists??
Monday, November 11, 2013 1:56 PM
Answers
-
Hi smlunatick,
Thanks for your posting.
To set permission in 61 users and everyone will be able to see the calendars of the other users, the script below may be helpful for you:
$allUsers = Get-Mailbox | Select Identity ForEach ( $user in $allUsers ) { Get-Mailbox | ForEach { If ( $_.Identity -ne $user.Identity ) { Add-MailboxFolderPermission $($_.SamAccountName)+":\calendar" -User $user.Identity -AccessRights PublishingEditor } } }
The purpose of the script If ( $_.Identity -ne $user.Identity ) is that in case the user in the first foreach loop meets up with himself in the second loop.
For more detailed script, you can also refer to this forum:
I hope this helps.
- Marked as answer by smlunatick Wednesday, December 18, 2013 2:48 PM
- Unmarked as answer by smlunatick Wednesday, December 18, 2013 3:47 PM
- Marked as answer by AnnaWY Monday, December 23, 2013 2:34 AM
Tuesday, November 12, 2013 7:21 AM
All replies
-
Hi smlunatick,
Thanks for your posting.
To set permission in 61 users and everyone will be able to see the calendars of the other users, the script below may be helpful for you:
$allUsers = Get-Mailbox | Select Identity ForEach ( $user in $allUsers ) { Get-Mailbox | ForEach { If ( $_.Identity -ne $user.Identity ) { Add-MailboxFolderPermission $($_.SamAccountName)+":\calendar" -User $user.Identity -AccessRights PublishingEditor } } }
The purpose of the script If ( $_.Identity -ne $user.Identity ) is that in case the user in the first foreach loop meets up with himself in the second loop.
For more detailed script, you can also refer to this forum:
I hope this helps.
- Marked as answer by smlunatick Wednesday, December 18, 2013 2:48 PM
- Unmarked as answer by smlunatick Wednesday, December 18, 2013 3:47 PM
- Marked as answer by AnnaWY Monday, December 23, 2013 2:34 AM
Tuesday, November 12, 2013 7:21 AM -
Thank you.
I now have the calendars shared correctly. It was suggested that I add these office 365 users to a security distribution group. Once in Outlook, I would just need to add the security group and the calendars would show up. Can I somehow "force" this with Power Shell??
- Edited by smlunatick Tuesday, November 12, 2013 2:28 PM
Tuesday, November 12, 2013 2:27 PM -
Hi smlunatick,
If you had created a new security distribution group, the script below is helpful for you, which make everyone that is a member of that group view the same group memebers calendar.
$GroupMembers = Get-DistributionGroupMember Group1 foreach ($GroupMember in $GroupMembers) { Add-MailboxFolderPermission -Identity (""+ $GroupMember.Guid+ ":\Calendar") -User Group1 -AccessRights Reviewer}
I hope this helps.- Marked as answer by AnnaWY Thursday, November 21, 2013 6:30 AM
- Unmarked as answer by smlunatick Wednesday, December 18, 2013 2:48 PM
Friday, November 15, 2013 5:11 AM -
How do I remove Calendar permission now?? For individual users and Groups ????Wednesday, December 18, 2013 2:49 PM
-
Hi,
How do I remove Calendar permission now?? For individual users and Groups ????
You can use Remove-MailboxFolderPermission:
http://technet.microsoft.com/en-us/library/dd351181%28v=exchg.150%29.aspx
If you have additional questions, you should start up a new thread.
Don't retire TechNet! - (Don't give up yet - 12,420+ strong and growing)
Wednesday, December 18, 2013 3:00 PM -
Let me rephrase this. After adding individual permissions for each users and for my group, I now need to remove the permissions and then re-do them.Wednesday, December 18, 2013 3:16 PM
-
Let me rephrase this. After adding individual permissions for each users and for my group, I now need to remove the permissions and then re-do them.
Let me rephrase this too. Your initial question has been answered (and you've marked an answer), so you should start a new thread for a new question. We try to keep one question per thread here or else things get confusing and overly complicated.
EDIT: Wow. I've never seen someone go so far to not start a new thread. Never mind....
Don't retire TechNet! - (Don't give up yet - 12,420+ strong and growing)
- Edited by Mike Laughlin Wednesday, December 18, 2013 3:54 PM
Wednesday, December 18, 2013 3:45 PM -
Hi Smlunatick,
We will appreciate if you can post your new question in a new thread, as Mike mentioned, we need to start a new thread for a new question.
Thank you for your understanding and efforts.
Best Regards,
Anna
Thursday, December 19, 2013 1:35 AM -
just a quick question in regards to office 365 calendar using powershell.
1) anyway to script where by 1 user able to view particular groups calendar share or particular OU (AD) calendar?
Please let me know. thanks.
Tuesday, April 1, 2014 9:49 AM -
This is quite helpful for me at the moment as I would like to make calendars viewable for a portion of employees. I have a distribution group which is officestaff@domain.com and would like to use this powershell script to allow those members to have viewable calendars within the group only. Does it matter that this is not a security group? Also how do input this group into the script to have it work? Thank you.
Wednesday, January 27, 2016 2:57 PM