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
Step 2 – Enter this command next-
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic –AllowRedirection
Step 3 – Enter this command to import the Office 365 session.
Import-PSSession $Session
Get/Add/Set/Remove mailbox calendar permissions
Step 4 – Use the Get-MailboxFolderPermision command to view calendar permissions for a user. Command-
Get-MailboxFolderPermission user.name:\calendar
(Replacing user.name with the user’s name)
Step 5 – Add a new permission using the Add-MailboxFolderPermission command. Command-
Add-MailboxFolderPermission user.name:\calendar –user user.name –accessrights reviewer
(Replacing user.name with the user’s usernames)
Step 6 – Change a permission using the Set-MailboxFolderPermission command. Command-
Set-MailboxFolderPermission user.name:\calendar –user user.name –accessrights editor
(Replacing user.name with the user’s usernames)
Step 7 – Removing a permission using the Remove-MailboxFolderPermission command. Command-
Remove-MailboxFolderPermission user.name:\calendar –user user.name
Disconnect Windows PowerShell from Office 365
Step 8 – Enter the following command to end the session on Windows PowerShell.
Remove-PSSession $Session