Skip to content

Instantly share code, notes, and snippets.

@sjwaight
Created February 22, 2016 12:02
Show Gist options
  • Save sjwaight/ff7dfc064c14ecf16c46 to your computer and use it in GitHub Desktop.
Save sjwaight/ff7dfc064c14ecf16c46 to your computer and use it in GitHub Desktop.
$myEmailOrUpn = 'some.user@some.doman'
# can use your mailbox login
$cred = Get-Credential
$exoSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $cred -Authentication "Basic" -AllowRedirection
# Loads session and EXO Cmdlets
Import-PSSession $exoSession
Get-Mailbox -Identity $myEmailOrUpn
Get-MailboxPreferredLocation -Identity $myEmailorUpn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment