Last Update: Version 1.98.88, August 9th, 2019

PowerShell script Connect-Office365Services.ps1 defines global functions to connect to various
Office 365 online services or Exchange On-Premises.

Call manually or alternatively embed or call from $profile (Shell or ISE) to make functions
available in your session. If loaded from PowerShell_ISE, menu items are defined for the
functions. To surpress creation of menu items, hold 'Shift' while Powershell ISE loads.

The following (global) functions are defined:

Read more about this script's usage on the related blog:

Revision History
1.2        Community release
1.3     Updated required version of Online Sign-In Assistant
1.4        Added (in-code) AzureEnvironment (Connect-AzureAD)
        Added version reporting for modules
1.5     Added support for Exchange Online PowerShell module w/MFA
        Added IE proxy config support
        Small cosmetic changes in output
1.51    Fixed PSSession for non-MFA EXO logons
        Changed credential entering logic for MFA
1.6     Added support for the Skype for Business PowerShell module w/MFA
        Added support for the SharePoint Online PowerShell module w/MFA
1.61    Fixed MFA choice bug
1.7     Added AzureAD PowerShell Module support
        For disambiguation, renamed Connect-AzureAD to Connect-AzureActiveDirectory
1.71    Added AzureADPreview PowerShell Module Support
1.72    Changed credential non-prompting condition for AzureAD
1.75    Added support for MFA-enabled Security & Compliance Center
        Added module version checks (online when possible) setting OnlineModuleVersionChecks
        Switched AzureADv1 to PS gallery version
        Removed Sign-In Assistant checks
        Added Set-Office365Environment to switch to other region, e.g. Germany, China etc.
1.76    Fixed version number checks for SfB & SP
1.77    Fixed version number checks for determining MFA status
        Changed default for online version checks to $false
1.78    Added usage of most recently dated ExO MFA module found (in case multiple are found)
        Changed connecting to SCC with MFA to using the underlying New-ExO cmdlet
1.80    Added Microsoft Teams PowerShell Module support
        Added Connect-MSTeams function
        Cleared default PSSessionOptions
        Some code rewrite (splatting)
1.81    Added support for ExO module 16.00.2020.000 w/MFA -Credential support
1.82    Bug fix SharePoint module version check
1.83    Removed Credentials option for ExO/MFA connect
1.84    Added Exchange ADAL loading support
1.85    Fixed menu creation in ISE
1.86    Updated version check for AzureADPreview (
        Added automatic module updating (Admin mode, OnlineModuleAutoUpdate & OnlineModuleVersionChecks)
1.87    Small bug fixes in outdated logic
        Added showing OnlineChecks/AutoUpdate/IsAdmin info
1.88    Updated module updating routine
        Updated SkypeOnlineConnector reference (PSGallery)
        Updated versions for Teams
1.89    Reverted back to installable SkypeOnlineConnector
1.90    Updated info for Azure Active Directory Preview module
        Updated info for Exchange Online Modern Authentication module
        Renamed 'Multi-Factor Authentication' to 'Modern Authentication'
1.91    Updated info for SharePoint Online module
        Fixed removal of old module(s) when updating
1.92    Updated AzureAD module
1.93    Updated Teams module 0.9.3
        Fixed typo in uninstall of old module when upgrading
1.94    Moved all global vars into one global hashtable (myOffice365Services)
        Updated AzureAD preview info (v2.0.1.11)
        Updated AzureAD info (v2.0.1.10)
1.95    Fixed version checking issue in Get-Office365Credentials
1.96    Updated AzureADv1 (MSOnline) info (v1.1.183.8)
        Fixed Skype & SharePoint Module version checking in Get-Office365Credentials()
1.97    Updated AzureAD Preview info (v2.0.1.17)
1.98    Updated Exchange Online info (16.0.2440.0)
        Updated AzureAD Preview info (v2.0.1.18)
        Updated AzureAD info (v2.0.1.16)
        Fixed Azure RMS location + info (v2.13.1.0)
        Added SharePointPnP Online (detection only)
1.98.1  Fixed Connect-ComplianceCenter function
1.98.2  Updated Exchange Online info (16.0.2433.0 - 2440 seems pulled)
        Added x86 notice (not all modules available for x86 platform)
1.98.3  Updated Exchange Online info (16.00.2528.000)
        Updated SharePoint Online info (v16.0.8029.0)
        Updated Microsoft Online info (
1.98.4  Updated AzureAD Preview info (
        Updated SharePoint Online info (16.0.8119.0)
        Updated Exchange Online info (16.00.2603.000)
        Updated MSOnline info (
        Updated AzureAD info (
        Updated SharePointPnP Online info (3.1.1809.0)
1.98.5  Added display of Tenant ID after providing credentials
1.98.6  Updated Teams info (0.9.5)
    Updated AzureAD Preview info (
        Updated SharePointPnP Online info (3.2.1810.0)
1.98.7  Modified Module Updating routing
1.98.8  Updated SharePoint Online info (16.0.8212.0)
        Added changing console title to Tenant info
        Rewrite initializing to make it manageable from profile
1.98.81 Updated Exchange Online info (16.0.2642.0)
1.98.82 Updated AzureAD info (
        Updated MicrosoftTeams info (0.9.6)
        Updated SharePoint Online info (16.0.8525.1200)
        Revised module auto-updating
1.98.83 Updated Teams info (1.0.0)
        Updated AzureAD v2 Preview info (
        Updated SharePoint Online info (16.0.8715.1200)
1.98.84 Updated Skype for Business Online info (7.0.1994.0)
1.98.85 Updated SharePoint Online info (16.0.8924.1200)
        Fixed setting Tenant Name for Connect-SharePointOnline
1.99.86 Updated Exchange Online info (16.0.3054.0)
1.99.87 Replaced 'not detected' with 'not found' for esthetics
1.99.88 Replaced AADRM module functionality with AIPModule
        Updated AzureAD info (
Added PowerApps modules (preview)
        Fixed handling when ExoPS module isn't installed