Last active
May 21, 2020 23:37
-
-
Save bmkaiser/6bd33f70a27648064f0a2b61a1608852 to your computer and use it in GitHub Desktop.
Fewer Keystrokes to Connect to Exchange Online with PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$env:UPN = (whoami /upn) | |
$PSDefaultParameterValues = @{ | |
'Connect-ExchangeOnline:UserPrincipalName' = "$env:UPN" | |
} | |
Set-Alias -Name cexo -Value Connect-ExchangeOnline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview
Add this code to your PowerShell profile to reduce the amount of typing required to connect to Exchange Online with the V2 module.
Before
Connect-ExchangeOnline -UserPrincipalName email@domain.com
After
cexo
Resources & Documentation