Connect to Exchange Online Protection using remote PowerShell


Connect to Exchange Online Protection using remote PowerShell

 

https://technet.microsoft.com/en-us/library/dn621036(v=exchg.160).aspx

 

 

  1. On your local computer, open Windows PowerShell and run the following command.
  2. $UserCredential = Get-Credential

    In the Windows PowerShell Credential Request dialog box, type your Exchange Online Protection user name and password, and then click OK.

  3. Run the following command.
  4. $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/.

  5. Run the following command.
  6. 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/.

Note:

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


 

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.