Editing Calendar Permissions in Office 365 via PowerShell
The company policy where I work is that everyone has Reviewer permissions for everyone else’s calendar. This is for scheduling purposes as well as for pulling the right people in to meetings as they’re getting set up. The problem is that (as far as I know) Exchange doesn’t let you do this company-wide, and in the past I’ve found a command (similar to the one in this post) to adjust the permissions for everyone’s calendar at once. The problem is that you have to keep doing it with every user that you add because it doesn’t apply to new users automatically and it took me a while to find a command to do it again recently, so I thought I’d throw a quick post together to document the one that I used this time, since it worked very well. I’ve written this post to do this for Office 365, but this should work for On-Prem Exchange servers as well.
The idea with the below script is that it finds everyone in a particular group and assigns the specified permissions to that user’s calendar for the group, so this could be used at a department level or even narrower than that.
$GroupMembers = Get-DistributionGroupMember <group name> foreach ($GroupMember in $GroupMembers) { Add-MailboxFolderPermission -Identity (""+ $GroupMember.Guid+ ":\Calendar") -User <group name> -AccessRights Reviewer}
The first time you run it, this command should execute successfully on all mailboxes (unless you’ve previously assigned these permissions to the group) but subsequent times that you run it (if you add employees, for instance) it will error out on users that you’ve already assigned these permissions. No big deal, the correct permissions will still be applied to the users that need it.
If you’ve never connected to Office 365 via PowerShell before, below is a quick list of things to do to get connected.
1. Install the Microsoft Online Services Sign-In Assistant using the following link.
http://go.microsoft.com/fwlink/?LinkId=286152
2. Install PowerShell on your machine through Add/Remove Programs or download and install the Azure AD PowerShell module using the following link.
http://technet.microsoft.com/en-us/library/jj151815.aspx
3. Launch the Azure AD PowerShell module and copy in the following commands, one at a time, and when prompted type in your Office 365 credentials (should be twice total).
Set-ExecutionPolicy Unrestricted
Command: $LiveCred = Get-Credential
Command: $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection
Command: Import-PSSession $Session
Connect-MsolService
Sources used to create this post are below:
http://www.365admin.co.uk/editing-calendar-permissions-office365-with-powershell/
Recent Comments