Created
December 7, 2022 01:12
-
-
Save SweetAsNZ/3d1632e7292c8b8de4e4dc27822eccd6 to your computer and use it in GitHub Desktop.
Connect to Exchange Online and Pass Your UPN
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
function Connect-Exchange | |
{ | |
$UPN = (([ADSISEARCHER]"samaccountname=$($env:USERNAME)").Findone().Properties).userprincipalname ; $UPN | |
Connect-ExchangeOnline -UserPrincipalName $UPN -ShowProgress $true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment