Using PowerShell on Linux to Check Office 365 Mailbox Permissions

In a previous post I installed PowerShell on my Arch Linux based system. Here I use it to check and amend Office 365 mailbox permissions.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[andy@home-pc ~]$ pwsh
PowerShell 6.1.1
Copyright (c) Microsoft Corporation. All rights reserved.
 
Type 'help' to get help.
 
PS /home/andy> $credential = Get-Credential
 
PowerShell credential request
Enter your credentials.
User: andy.pike@pikedom.com
Password for user andy.pike@pikedom.com: **********
 
PS /home/andy> $ExchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $credential -Authentication "Basic" -AllowRedirection
PS /home/andy>
PS /home/andy> Import-PSSession $ExchangeSession
 
ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.0        tmp_0yjqlacy.r2b                    {Add-DistributionGroupMember, Add-Mailbox...
 
PS /home/andy>
PS /home/andy> Get-MailboxFolderPermission -Identity andy.pike@pikedom.com:\Calendar
 
FolderName           User                 AccessRights                   SharingPermissionFlags
----------           ----                 ------------                   ----------------------
Calendar             Default              {AvailabilityOnly}            
Calendar             Anonymous            {None}                        
Calendar             everyone             {Reviewer}                    
 
PS /home/andy>

If you needed to give everyone Reviewer access, you would issue something like the below:

1
PS /home/andy> Get-MailboxFolderPermission -Identity andy.pike@pikedom.com:\Calendar -User everyone -AccessRights Reviewer

To disconnect, issue:

1
PS /home/andy> Get-PSSession | Remove-PSSession

Be the first to comment

Leave a Reply