Azure Powershell function to connect to 0365 / Exchange online

exchange

BOSS: “Hey you, the one with the folic issues, get over here”

BaldyAdmin: “yes oh hairy headed one, how may I serve you?”

BOSS: Bob want to connect to our o365 account and do useful stuff but he needs to do it faster.

BaldyAdmin: “I’m on it”

##Lets make it easy for Bob to connect with a reusable powershell function:

######################

Function Connect-O365{

import-module MSOnline

$UserCredential = Get-Credential youraccounthere@something.onmicrosoft.com

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

Import-PSSession $Session
}
Connect-O365

========================

BaldyAdmin: “Hey Boss, Bob has a cool new function that saves him at least 10 mouse clicks.”

BOSS: “Your a genius, perhaps brains work better without insulation?”

If you liked this post please leave a comment.

The Baldy Admin

Leave a comment