Peterborough: 01733 600700 London: 020 3198 6520 Email: info@leadtec.co.uk

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

Blogs

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 https://outlook.office365.com/powershell-liveid/ -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-
Get-MailboxFolderPermission user.name:\calendar
(Replacing user.name with the user’s name)

Window PowerShell coding.

 

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)

Window PowerShell code.

 

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)

Window PowerShell Code

 

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

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.