Connect to O365 Sometimes we may have the need to change the time-out period for our OWA sessions while using O365. O365 supports 15 minutes (00:15:00) at its lowest setting, up to 8 hours (08:00:00), with the default being 6 hours. Set-OrganizationConfig -ActivityBasedAuthenticationTimeoutEnabled $true -ActivityBasedAuthenticationTimeoutInterval 00:15:00 -ActivityBasedAuthenticationTimeoutWithSingleSignOnEnabled $true Disabling the time-out period for Office 365 is currently not supported.
Install-Module -Name AzureAD $UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session