Connecting to Exchange Online Power shell

Open Power shell as an admin.

$Username = “admin@xxx.onmicrosoft.com”
$Password = ConvertTo-SecureString ‘12345678’ -AsPlainText -Force
$LiveCred = New-Object System.Management.Automation.PSCredential $Username, $Password

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection

OR (If the above doesn’t work)

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session

Connect-MsolService –Credential $LiveCred

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a website or blog at WordPress.com

Up ↑