Skip to content

Commit 2174158

Browse files
Merge pull request MicrosoftDocs#1 from praveenkumathalli/patch-2
Patch 2
2 parents d036717 + b35b8d0 commit 2174158

File tree

1,238 files changed

+3215
-537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,238 files changed

+3215
-537
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: "Connect to Exchange Online Protection PowerShell"
3+
ms.author: chrisda
4+
author: chrisda
5+
manager: serdars
6+
ms.date: 7/10/2017
7+
ms.audience: Admin
8+
ms.topic: article
9+
ms.service: eop
10+
localization_priority: Normal
11+
ms.assetid: 054e0fd7-d465-4572-93f8-a00a9136e4d1
12+
description: "Use remote PowerShell to connect to an Exchange Online Protection organization"
13+
---
14+
15+
# Connect to Exchange Online Protection PowerShell
16+
17+
Exchange Online Protection PowerShell allows you to manage your Exchange Online Protection settings from the command line. You use Windows PowerShell on your local computer to create a remote PowerShell session to Exchange Online Protection. It's a simple three-step process where you enter your Office 365 credentials, provide the required connection settings, and then import the Exchange Online Protection cmdlets into your local Windows PowerShell session so that you can use them.
18+
19+
## What do you need to know before you begin?
20+
21+
- Estimated time to complete: 5 minutes
22+
23+
- You can use the following versions of Windows:
24+
25+
- Windows 10
26+
27+
- Windows 8.1
28+
29+
- Windows Server 2016
30+
31+
- Windows Server 2012 or Windows Server 2012 R2
32+
33+
- Windows 7 Service Pack 1 (SP1)\*
34+
35+
- Windows Server 2008 R2 SP1\*
36+
37+
\* You need to install the Microsoft.NET Framework 4.5 or later and then either the Windows Management Framework 3.0 or the Windows Management Framework 4.0. For more information, see [Installing the .NET Framework](https://go.microsoft.com/fwlink/p/?LinkId=257868) and [Windows Management Framework 3.0](https://go.microsoft.com/fwlink/p/?LinkId=272757) or [Windows Management Framework 4.0](https://go.microsoft.com/fwlink/p/?LinkId=391344).
38+
39+
- Windows PowerShell needs to be configured to run scripts, and by default, it isn't. You get the following error when you try to connect:
40+
41+
`Files cannot be loaded because running scripts is disabled on this system. Provide a valid certificate with which to sign the files.`
42+
43+
To enable Windows PowerShell to run signed scripts, run the following command in an elevated Windows PowerShell window (a Windows PowerShell window you open by selecting **Run as administrator**):
44+
45+
```
46+
Set-ExecutionPolicy RemoteSigned
47+
```
48+
49+
You need to configure this setting only once on your computer, not every time you connect.
50+
51+
> [!TIP]
52+
> Having problems? Ask for help in the Exchange forums. Visit the forums at: [Exchange Server](https://go.microsoft.com/fwlink/p/?linkId=60612), [Exchange Online](https://go.microsoft.com/fwlink/p/?linkId=267542), or [Exchange Online Protection](https://go.microsoft.com/fwlink/p/?linkId=285351).
53+
54+
## Connect to Exchange Online Protection
55+
56+
1. On your local computer, open Windows PowerShell and run the following command.
57+
58+
```
59+
$UserCredential = Get-Credential
60+
```
61+
62+
In the **Windows PowerShell Credential Request** dialog box, type your work or school account and password, and then click **OK**.
63+
64+
2. Run the following command.
65+
66+
```
67+
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.protection.outlook.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
68+
```
69+
70+
**Notes**:
71+
72+
- For Office 365 Germany, use the _ConnectionUri_ value: `https://ps.protection.outlook.de/powershell-liveid/`
73+
74+
- For Exchange Online Protection subscriptions that are Exchange Enterprise CAL with Services (includes data loss prevention (DLP) and reporting using web services), use the _ConnectionUri_ value: `https://outlook.office365.com/powershell-liveid/`
75+
76+
3. Run the following command.
77+
78+
```
79+
Import-PSSession $Session
80+
```
81+
82+
[!NOTE]
83+
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:
84+
85+
```
86+
Remove-PSSession $Session
87+
```
88+
89+
## How do you know this worked?
90+
91+
After Step 3, the Exchange Online Protection cmdlets are imported into your local Windows PowerShell session and tracked by a progress bar. If you don't receive any errors, you connected successfully. A quick test is to run an Exchange Online Protection cmdlet, for example, **Get-TransportRule**, and see the results.
92+
93+
If you receive errors, check the following requirements:
94+
95+
- A common problem is an incorrect password. Run the three steps again and pay close attention to the user name and password you enter in Step 1.
96+
97+
- To help prevent denial-of-service (DoS) attacks, you're limited to three open remote PowerShell connections to your Exchange Online Protection organization.
98+
99+
- TCP port 80 traffic needs to be open between your local computer and Office 365. It's probably open, but it's something to consider if your organization has a restrictive Internet access policy.
100+
101+
## See also
102+
103+
The cmdlets that you use in this topic are Windows PowerShell cmdlets. For more information about these cmdlets, see the following topics.
104+
105+
- [Get-Credential](https://go.microsoft.com/fwlink/p/?LinkId=389618)
106+
107+
- [New-PSSession](https://go.microsoft.com/fwlink/p/?LinkId=389621)
108+
109+
- [Import-PSSession](https://go.microsoft.com/fwlink/p/?LinkId=389619)
110+
111+
- [Remove-PSSession](https://go.microsoft.com/fwlink/p/?LinkId=389620)
112+
113+
- [Set-ExecutionPolicy](https://go.microsoft.com/fwlink/p/?LinkId=389623)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: "Exchange Online Protection PowerShell"
3+
ms.author: chrisda
4+
author: chrisda
5+
manager: serdars
6+
ms.date: 2/20/2018
7+
ms.audience: Admin
8+
ms.topic: article
9+
ms.service: eop
10+
localization_priority: Normal
11+
ms.assetid: f7918a88-774a-405e-945b-bc2f5ee9f748
12+
description: "Learn about using PowerShell in Exchange Online Protection"
13+
---
14+
15+
# Exchange Online Protection PowerShell
16+
17+
Exchange Online Protection PowerShell is the administrative interface that enables you to manage your Exchange Online Protection (EOP) organization from the command line. For example, you can use Exchange Online Protection PowerShell to configure mail flow rules (also known as transport rules) and connectors. The following topics provide information about using Exchange Online Protection PowerShell:
18+
19+
- To create a remote PowerShell session to your Exchange Online Protection organization, see [Connect to Exchange Online Protection PowerShell](connect-to-exchange-online-protection-powershell.md).
20+
21+
- For a sample script that lets admins who manage multiple tenants (companies) apply configuration settings to their tenants, see [Sample script for applying EOP settings to multiple tenants](http://technet.microsoft.com/library/e87e84e1-7be0-44bf-a414-d91d60ed8817.aspx).
22+
23+
- The following introductory video shows you how to connect to and use Exchange Online Protection PowerShell.
24+
25+
**Note:** This video applies to Exchange Online and EOP organizations. When you connect to your organization, be careful to specify the correct URL (_ConnectionUri_ value). The required URL is different for Exchange Online and EOP organizations.
26+
27+
[Use Remote PowerShell in EOP](https://videoplayercdn.osi.office.net/hub/?csid=ux-cms-en-us-msoffice&uuid=9cb28006-c2cb-45b6-b72e-eeed8767dee7&AutoPlayVideo=false)
28+
29+
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
---
2+
title: "Connect to Exchange Online PowerShell"
3+
ms.author: chrisda
4+
author: chrisda
5+
manager: serdars
6+
ms.date: 7/10/2017
7+
ms.audience: Admin
8+
ms.topic: article
9+
ms.service: exchange-online
10+
localization_priority: Normal
11+
ms.custom: Strat_EX_Admin
12+
ms.assetid: c8bea338-6c1a-4bdf-8de0-7895d427ee5b
13+
description: "Learn how to use remote PowerShell to connect to Exchange Online."
14+
---
15+
16+
# Connect to Exchange Online PowerShell
17+
Exchange Online PowerShell allows you to manage your Exchange Online settings from the command line. You use Windows PowerShell on your local computer to create a remote PowerShell session to Exchange Online. It's a simple three-step process where you enter your Office 365 credentials, provide the required connection settings, and then import the Exchange Online cmdlets into your local Windows PowerShell session so that you can use them.
18+
19+
> [!IMPORTANT]
20+
> If you want to use multi-factor authentication (MFA) to connect to Exchange Online PowerShell, you need to download and use the Exchange Online Remote PowerShell Module. For more information, see [Connect to Exchange Online PowerShell using multi-factor authentication](mfa-connect-to-exchange-online-powershell.md). If you're an Exchange Online Protection (EOP) standalone customer, and you're using the service to protect on-premises mailboxes, use the connection instructions in the topic [Connect to Exchange Online Protection PowerShell](../../exchange-eop/connect-to-exchange-online-protection-powershell.md). If your EOP subscription is Exchange Enterprise CAL with Services (includes data loss prevention (DLP) and reporting using web services), the connection instructions in this topic will work for you.
21+
22+
## What do you need to know before you begin?
23+
24+
- Estimated time to complete: 5 minutes
25+
26+
- You can use the following versions of Windows:
27+
28+
- Windows 10
29+
30+
- Windows 8.1
31+
32+
- Windows Server 2016
33+
34+
- Windows Server 2012 or Windows Server 2012 R2
35+
36+
- Windows 7 Service Pack 1 (SP1)\*
37+
38+
- Windows Server 2008 R2 SP1\*
39+
40+
\* You need to install the Microsoft.NET Framework 4.5 or later and then either the Windows Management Framework 3.0 or the Windows Management Framework 4.0. For more information, see [Installing the .NET Framework](https://go.microsoft.com/fwlink/p/?LinkId=257868) and[Windows Management Framework 3.0](https://go.microsoft.com/fwlink/p/?LinkId=272757) or[Windows Management Framework 4.0](https://go.microsoft.com/fwlink/p/?LinkId=391344).
41+
42+
- Windows PowerShell needs to be configured to run scripts, and by default, it isn't. You get the following error when you try to connect:
43+
44+
`Files cannot be loaded because running scripts is disabled on this system. Provide a valid certificate with which to sign the files.`
45+
46+
To enable Windows PowerShell to run signed scripts, run the following command in an elevated Windows PowerShell window (a Windows PowerShell window you open by selecting **Run as administrator**):
47+
48+
```
49+
Set-ExecutionPolicy RemoteSigned
50+
```
51+
52+
You need to configure this setting only once on your computer, not every time you connect.
53+
54+
55+
> [!TIP]
56+
> Having problems? Ask for help in the Exchange forums. Visit the forums at: [Exchange Online](https://go.microsoft.com/fwlink/p/?linkId=267542), or [Exchange Online Protection](https://go.microsoft.com/fwlink/p/?linkId=285351).
57+
58+
## Connect to Exchange Online PowerShell
59+
60+
1. On your local computer, open Windows PowerShell and run the following command.
61+
62+
```
63+
$UserCredential = Get-Credential
64+
```
65+
In the **Windows PowerShell Credential Request** dialog box, type your work or school account and password, and then click **OK**.
66+
67+
2. Run the following command.
68+
69+
```
70+
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
71+
```
72+
73+
**Notes**:
74+
75+
- For Office 365 operated by 21Vianet, use the _ConnectionUri_ value: `https://partner.outlook.cn/PowerShell`
76+
77+
- For Office 365 Germany, use the _ConnectionUri_ value: `https://outlook.office.de/powershell-liveid/`
78+
79+
3. Run the following command.
80+
81+
```
82+
Import-PSSession $Session
83+
```
84+
85+
> [!NOTE]
86+
> 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.
87+
88+
```
89+
Remove-PSSession $Session
90+
```
91+
92+
## How do you know this worked?
93+
94+
After Step 3, the Exchange Online cmdlets are imported into your local Windows PowerShell session and tracked by a progress bar. If you don't receive any errors, you connected successfully. A quick test is to run an Exchange Online cmdlet, for example, **Get-Mailbox**, and see the results.
95+
96+
If you receive errors, check the following requirements:
97+
98+
- A common problem is an incorrect password. Run the three steps again and pay close attention to the user name and password you enter in Step 1.
99+
100+
- To help prevent denial-of-service (DoS) attacks, you're limited to three open remote PowerShell connections to your Exchange Online organization.
101+
102+
- The account you use to connect to Exchange Online must be enabled for remote PowerShell. For more information, see [Enable or disable access to Exchange Online PowerShell](../disable-access-to-exchange-online-powershell.md).
103+
104+
- TCP port 80 traffic needs to be open between your local computer and Office 365. It's probably open, but it's something to consider if your organization has a restrictive Internet access policy.
105+
106+
## See also
107+
108+
The cmdlets that you use in this topic are Windows PowerShell cmdlets. For more information about these cmdlets, see the following topics.
109+
110+
- [Get-Credential](https://go.microsoft.com/fwlink/p/?LinkId=389618)
111+
112+
- [New-PSSession](https://go.microsoft.com/fwlink/p/?LinkId=389621)
113+
114+
- [Import-PSSession](https://go.microsoft.com/fwlink/p/?LinkId=389619)
115+
116+
- [Remove-PSSession](https://go.microsoft.com/fwlink/p/?LinkId=389620)
117+
118+
- [Set-ExecutionPolicy](https://go.microsoft.com/fwlink/p/?LinkId=389623)
119+
120+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
title: "Connect to Exchange Online PowerShell using multi-factor authentication"
3+
ms.author: chrisda
4+
author: chrisda
5+
ms.date: 10/24/2017
6+
ms.audience: Admin
7+
ms.topic: article
8+
ms.service: exchange-online
9+
localization_priority: Normal
10+
ms.assetid: 04dae4ce-34a7-49c5-bf75-11e72452e04a
11+
description: "Learn how to connect to Exchange Online PowerShell by using multi-factor authentication (MFA)."
12+
---
13+
14+
# Connect to Exchange Online PowerShell using multi-factor authentication
15+
If you want to use multi-factor authentication (MFA) to connect to Exchange Online PowerShell, you can't use the instructions at [Connect to Exchange Online PowerShell](connect-to-exchange-online-powershell.md) to use remote PowerShell to connect to Exchange Online. MFA requires you to install the Exchange Online Remote PowerShell Module, and use the **Connect-EXOPSSession** cmdlet to connect.
16+
17+
> [!NOTE]
18+
> You can't use the Exchange Online Remote PowerShell Module to connect to Exchange Online PowerShell and Security & Compliance Center PowerShell in the same session (window). You need to use separate sessions of the Exchange Online Remote PowerShell Module.
19+
20+
## What do you need to know before you begin?
21+
22+
- Estimated time to complete: 5 minutes
23+
24+
- The Exchange Online Remote PowerShell Module needs to be installed on your computer:
25+
26+
1. Open the Exchange admin center (EAC) for your Exchange Online organization. For instructions, see [Exchange Admin Center in Exchange Online](http://technet.microsoft.com/library/ace44f6b-4084-4f9c-89b3-e0317962472b.aspx).
27+
28+
2. In the EAC, go to **Hybrid** > **Setup** and click the appropriate **Configure** button to download the Exchange Online Remote PowerShell Module for multi-factor authentication.
29+
30+
![Download the Exchange Online PowerShell Module from the Hybrid tab in the EAC](../../media/24645e56-8b11-4c0f-ace4-09bdb2703562.png)
31+
32+
3. In the **Application Install** window that opens, click **Install**.
33+
34+
![Click Install in the Exchange Online PowerShell Module window](../../media/0fd389a1-a32d-4e2f-bf5f-78e9b6407d4c.png)
35+
36+
- Windows Remote Management (WinRM) on your computer needs to allow basic authentication (it's enabled by default). To verify that basic authentication is enabled, run this command in a Command Prompt:
37+
38+
```
39+
winrm get winrm/config/client/auth
40+
```
41+
42+
If you don't see the value `Basic = true`, you need to run this command to enable basic authentication for WinRM:
43+
44+
```
45+
winrm set winrm/config/client/auth @{Basic="true"}
46+
```
47+
48+
If basic authentication is disabled, you'll get this error when you try to connect:
49+
50+
`The WinRM client cannot process the request. Basic authentication is currently disabled in the client configuration. Change the client configuration and try the request again.`
51+
52+
53+
> [!TIP]
54+
> Having problems? Ask for help in the Exchange forums. Visit the forums at: [Exchange Online](https://go.microsoft.com/fwlink/p/?linkId=267542), or [Exchange Online Protection](https://go.microsoft.com/fwlink/p/?linkId=285351).
55+
56+
## Connect to Exchange Online PowerShell by using MFA
57+
58+
1. On your local computer, open the **Exchange Online Remote PowerShell Module** ( **Microsoft Corporation** > **Microsoft Exchange Online Remote PowerShell Module**).
59+
60+
2. The command that you need to run uses the following syntax:
61+
62+
```
63+
Connect-EXOPSSession -UserPrincipalName <UPN> [-ConnectionUri <ConnectionUri> -AzureADAuthorizationEndPointUri <AzureADUri>]
64+
```
65+
66+
- _\<UPN\>_ is your Office 365 work or school account.
67+
68+
- The _\<ConnectionUri\>_ and _\<AzureADUri\>_ values depend on the location of your Office 365 organization as described in the following table:
69+
70+
|**Office 365 offering**|**_ConnectionUri_ parameter value**|**_AzureADAuthorizationEndPointUri_ parameter value**|
71+
|:-----|:-----|:-----|
72+
|Office 365|Not used|Not used|
73+
|Office 365 Germany|`https://outlook.office.de/PowerShell-LiveID`|`https://login.microsoftonline.de/common`|
74+
75+
This example connects to Exchange Online in Office 365 using the account [email protected].
76+
77+
```
78+
Connect-EXOPSSession -UserPrincipalName [email protected]
79+
```
80+
81+
This example connects to Exchange Online in Office 365 Germany using the account [email protected].
82+
83+
```
84+
Connect-EXOPSSession -UserPrincipalName [email protected] -ConnectionUri https://outlook.office.de/PowerShell-LiveID -AzureADAuthorizationEndPointUri https://login.microsoftonline.de/common
85+
```
86+
87+
3. In the sign-in window that opens, enter your password, and then click **Sign in**.
88+
89+
![Enter your password in the Exchange Online Remote PowerShell window](../../media/b85d80d9-1043-4c7c-8f14-d87d8d56b188.png)
90+
91+
A verification code is generated and delivered based on the verification response option that's configured for your account (for example, a text message or the Azure Authenticator app on your mobile phone).
92+
93+
4. In the verification window that opens, enter the verification code, and then click **Sign in**.
94+
95+
![Enter your verification code in the Exchange Online Remote PowerShell window](../../media/d3a405ce-5364-4732-a7bb-2cc9c678da2d.png)
96+
97+
## How do you know this worked?
98+
99+
After Step 4, the Exchange Online cmdlets are imported into your Exchange Online Remote PowerShell Module session and tracked by a progress bar. If you don't receive any errors, you connected successfully. A quick test is to run an Exchange Online cmdlet, for example, **Get-Mailbox**, and see the results.
100+
101+
If you receive errors, check the following requirements:
102+
103+
- To help prevent denial-of-service (DoS) attacks, you're limited to three open remote PowerShell connections to your Exchange Online organization.
104+
105+
- The account you use to connect to Exchange Online must be enabled for remote PowerShell. For more information, see [Enable or disable access to Exchange Online PowerShell](../disable-access-to-exchange-online-powershell.md).
106+
107+
- TCP port 80 traffic needs to be open between your local computer and Office 365. It's probably open, but it's something to consider if your organization has a restrictive Internet access policy.
108+
109+

0 commit comments

Comments
 (0)