Connect to Exchange Online Protection using remote PowerShell
https://technet.microsoft.com/en-us/library/dn621036(v=exchg.160).aspx
- On your local computer, open Windows PowerShell and run the following command.
-
$UserCredential = Get-Credential
In the Windows PowerShell Credential Request dialog box, type your Exchange Online Protection user name and password, and then click OK.
- Run the following command.
-
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.protection.outlook.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Note If your Exchange Online Protection subscription is Exchange Enterprise CAL with Services (includes data loss prevention (DLP) and reporting using web services), use the following value for the ConnectionUri parameter: https://outlook.office365.com/powershell-liveid/.
- Run the following command.
- Import-PSSession $Session
If your Exchange Online Protection subscription is Exchange Enterprise CAL with Services (includes data loss prevention (DLP) and reporting using web services), use the following value for the ConnectionUri parameter: https://outlook.office365.com/powershell-liveid/.
|
Be sure to disconnect the remote PowerShell session when you’re finished. If you close the Windows PowerShell window without disconnecting the session, you could use up all the remote PowerShell sessions available to you, and you’ll need to wait for the sessions to expire. To disconnect the remote PowerShell session, run the following command. |
Remove-PSSession $Session