Forum Discussion
Set folder permissions to O365 Group members PS
This is how would do this:
Yes, there is another way to set default permissions for the Outlook calendars of members of a specific Office 365 group using PowerShell.
You can use the following command to retrieve the members of the Office 365 group:
Get-UnifiedGroupLinks -Identity <groupname> -LinkType Members
This will return the members of the group. You can then loop through the members and set the default permissions for their calendars using the following command:
Add-MailboxFolderPermission -Identity <useremail>:\Calendar -User <useremail> -AccessRights Editor
You can put these commands together in a script to automate the process for all members of the group. Here's an example:
$members = Get-UnifiedGroupLinks -Identity <groupname> -LinkType Members foreach ($memberin $members) { $user = Get-Mailbox -Identity $member.PrimarySmtpAddress Add-MailboxFolderPermission -Identity $user:\Calendar -User $user.PrimarySmtpAddress -AccessRights Editor }
Hi Mark_Albin
Thanks for taking your time to comment!
The first part is exactly what I explained in my post and, unfortunately, your script will not work, ( test it 😉 ).
If you would like to use the PrimarySmtpAdress instead of Alias, I'll suggest you to use this one, ( tested and works 😞
$members = Get-UnifiedGroupLinks -Identity <group address> -LinkType Members
foreach ($member in $members){
$user = $member.PrimarySmtpAddress+":\Calendar"
Set-MailboxFolderPermission -Identity $user -User Default -AccessRights LimitedDetails}
It's similar to my fist one but yes, you're right that this would work as well.
Hope this helps 🙂
Have a nice day.