Peterborough: 01733 600700 London: 020 3198 6520 Email:

Posted on: 9th of February, 2017
By: Leadtec User


Connect Windows PowerShell to Office 365

Step 1 – Open Windows PowerShell & enter the following command.
$UserCredential = Get-Credential
Enter your Office 365 admin credentials

Windows PowerShell credentials


Step 2 – Enter this command next-
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic –AllowRedirection

Window PowerShell code


Step 3 – Enter this command to import the Office 365 session.
Import-PSSession $Session

Window PowerShell text.


Get/Add/Set/Remove mailbox calendar permissions

Step 4 – Use the Get-MailboxFolderPermision command to view calendar permissions for a user. Command-
(Replacing with the user’s name)

Window PowerShell coding.


Step 5 – Add a new permission using the Add-MailboxFolderPermission command. Command-
Add-MailboxFolderPermission\calendar –user –accessrights reviewer
(Replacing with the user’s usernames)

Window PowerShell code.


Step 6 – Change a permission using the Set-MailboxFolderPermission command. Command-
Set-MailboxFolderPermission\calendar –user –accessrights editor
(Replacing with the user’s usernames)

Window PowerShell Code


Step 7 – Removing a permission using the Remove-MailboxFolderPermission command. Command-
Remove-MailboxFolderPermission\calendar –user

Window PowerShell Code.


Disconnect Windows PowerShell from Office 365

Step 8 – Enter the following command to end the session on Windows PowerShell.
Remove-PSSession $Session


Window PowerShell Remove Session.