As your organization’s Office 365 administrator, you’ll certainly need to access Exchange Online to manage the account just like you would with the on-premise Exchange server. There will be a time that you need to run PowerShell cmdlets instead of configuring directly on the Office 365 Exchange Online web portal. With Remote Power Shell, it allows you to connect to your Exchange Online to manage your settings. It’s a simple process.
- On your local computer, open Windows PowerShell with elevated permission (Run as administrator).
- Then run the following command,
$UserCredential = Get-Credential
- In the Windows PowerShell Credential Request dialog box, type your Exchange Online user name and password, and then click OK.
- Then run the following command,
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
- Next, run the following command,
Set-ExecutionPolicy RemoteSigned
- Once it’s done downloading the set of policy, you need to accept it by typing Y
- Then type in the next command,
Import-PSSession $Session
- It will begin to import PowerShell cmdlets library into your session.
- Now you can begin run your Exchange PowerShell cmdlets to manage your Office 365 account.
- Once you’re done, to disconnect your session, you need to run the following command,
Remove-PSSession $Session