I am tempted to update my previously written(2016) –> All in One Office 365 Powershell Connect as New Shells have arrived and we admins have to work with those.
I am including the support for Exchange Online MFA/Compliance and security MFA by adding below function inside the existing Script.
https://github.com/VikasSukhija/Downloads/blob/master/O365.ps1
- LaunchEOL/RemoveEOL (Exchange Online)
- LaunchEOLMFA/RemoveEOLMFA (Exchange Online with MFA)
- LaunchSOL/RemoveSOL (Skype online)
- LaunchSPO/RemoveSPO (Sharepoint online)
- LaunchCOL/RemoveCOL (Security & Compliance)
- LaunchCOLMFA/RemoveCOLMFA (Security & Compliance)
- LaunchMSOL/RemoveMSOL (MSonline Azure activedirectory)
#####################################################################
Function LaunchEOLMFA {
Import-Module $((Get-ChildItem -Path $($env:LOCALAPPDATA+”\Apps\2.0\”) -Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse ).FullName|?{$_ -notmatch “_none_”}|select -First 1)
$EOLSession = New-ExoPSSession
Import-PSSession $EOLSession -Prefix “EOL” -AllowClobber -Verbose
}
Function RemoveEOLMFA {
$Session = Get-PSSession | where {$_.ComputerName -like “outlook.office365.com”}
Remove-PSSession $Session
}
#######################################################################
Note: You need to have Exchange Online MFA Shell (Click here) to make it work.
You can just launch it from your system as below ones you have set it up following the existing All in One Office 365 Powershell Connect blog post.
All commands have prefix added to differentiate it from its onpremise versions which greatly assists hybrid admins scripts and administration.
For example: Get-EOLMailbox instead of Get-mailbox
Thanks for reading and downloading
Tech Wizard
Pingback: All in One Office 365 Powershell Connect – Includes Exchange online MFA | Cloud Computers Guide
Pingback: End of Exchange Online Classic Authentication | Tech Wizard
Pingback: PowerShell System Admin Module | Tech Wizard