Manage Exchange Online with PowerShell

The following commands shows you how to connect to Exchange online with the Exchange Online PowerShell module.

# You need to configure this setting only once on your computer, not every time you connect. Set-ExecutionPolicy RemoteSigned -force # Connect to Exchange Online PowerShell $UserCredential = Get-Credential # Creates a persistent connection to a local or remote computer. $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic -AllowRedirection # Make connection Import-PSSession # your commands here... # End session Get-PSSession | Remove-PSSession