You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exchange/docs-conceptual/exchange-eop/connect-to-exchange-online-protection-powershell.md
+21-17Lines changed: 21 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
title: "Connect to Exchange Online Protection PowerShell"
3
3
ms.author: chrisda
4
4
author: chrisda
5
-
manager: serdars
6
-
ms.date: 5/9/2018
5
+
manager: dansimp
6
+
ms.date:
7
7
ms.audience: Admin
8
8
ms.topic: article
9
9
ms.service: eop
@@ -14,18 +14,22 @@ description: "Use remote PowerShell to connect to an Exchange Online Protection
14
14
15
15
# Connect to Exchange Online Protection PowerShell
16
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.
17
+
Exchange Online Protection PowerShell allows you to manage your Exchange Online Protection organization 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
18
19
19
## What do you need to know before you begin?
20
20
21
21
- Estimated time to complete: 5 minutes
22
22
23
+
- Exchange Online Protection PowerShell is only used in *standalone* EOP organizations (for example, you have a standalone EOP subscription to protect your on-premises email environment). If you have an Office 365 subscription that includes EOP (E3, E5, etc.), you don't use Exchange Online Protection PowerShell; the same features are available in [Exchange Online PowerShell](../exchange-online/exchange-online-powershell.md).
24
+
23
25
- You can use the following versions of Windows:
24
26
25
27
- Windows 10
26
28
27
29
- Windows 8.1
28
30
31
+
- Windows Server 2019
32
+
29
33
- Windows Server 2016
30
34
31
35
- Windows Server 2012 or Windows Server 2012 R2
@@ -36,13 +40,13 @@ Exchange Online Protection PowerShell allows you to manage your Exchange Online
36
40
37
41
<sup>*</sup> For older versions of Windows, you need to install the Microsoft.NET Framework 4.5 or later and then an updated version of the Windows Management Framework: 3.0, 4.0, or 5.1 (only one). For more information, see [Installing the .NET Framework](https://go.microsoft.com/fwlink/p/?LinkId=257868), [Windows Management Framework 3.0](https://go.microsoft.com/fwlink/p/?LinkId=272757), [Windows Management Framework 4.0](https://go.microsoft.com/fwlink/p/?LinkId=391344), and [Windows Management Framework 5.1](https://aka.ms/wmf5download).
38
42
39
-
- Windows PowerShell needs to be configured to run scripts, and by default, it isn't. You'll get the following error when you try to connect:
43
+
- Windows PowerShell needs to be configured to run scripts, and by default, it isn't. You'll get the following error when you try to connect:
40
44
41
45
`Files cannot be loaded because running scripts is disabled on this system. Provide a valid certificate with which to sign the files.`
42
46
43
47
To require all scripts that you download from the internet are signed by a trusted publisher, run the following command in an elevated Windows PowerShell window (a Windows PowerShell window you open by selecting **Run as administrator**):
44
48
45
-
```
49
+
```PowerShell
46
50
Set-ExecutionPolicy RemoteSigned
47
51
```
48
52
@@ -55,15 +59,15 @@ Exchange Online Protection PowerShell allows you to manage your Exchange Online
55
59
56
60
1. On your local computer, open Windows PowerShell and run the following command:
57
61
58
-
```
62
+
```PowerShell
59
63
$UserCredential = Get-Credential
60
64
```
61
65
62
66
In the **Windows PowerShell Credential Request** dialog box, type your work or school account and password, and then click **OK**.
@@ -75,23 +79,23 @@ Exchange Online Protection PowerShell allows you to manage your Exchange Online
75
79
76
80
3. Run the following command:
77
81
78
-
```
82
+
```PowerShell
79
83
Import-PSSession $Session -DisableNameChecking
80
84
```
81
85
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
+
>[!NOTE]
87
+
> 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:
88
+
89
+
```PowerShell
86
90
Remove-PSSession $Session
87
91
```
88
92
89
93
## How do you know this worked?
90
94
91
95
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
-
96
+
93
97
If you receive errors, check the following requirements:
94
-
98
+
95
99
- 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
100
97
101
- To help prevent denial-of-service (DoS) attacks, you're limited to three open remote PowerShell connections to your Exchange Online Protection organization.
@@ -100,14 +104,14 @@ If you receive errors, check the following requirements:
100
104
101
105
- The **New-PSSession** command (Step 2) might fail to connect if your client IP address changes during the connection request. This can happen if your organization uses a source network address translation (SNAT) pool that contains multiple IP addresses. The connection error looks like this:
102
106
103
-
`The request for the Windows Remote Shell with ShellId <ID> failed because the shell was not found on the server. Possible causes are: the specified ShellId is incorrect or the shell no longer exists on the server. Provide the correct ShellId or create a new shell and retry the operation.`
107
+
`The request for the Windows Remote Shell with ShellId <ID> failed because the shell was not found on the server. Possible causes are: the specified ShellId is incorrect or the shell no longer exists on the server. Provide the correct ShellId or create a new shell and retry the operation.`
104
108
105
-
To fix the issue, use an SNAT pool that contains a single IP address, or force the use of a specific IP address for connections to the Exchange Online Protection PowerShell endpoint.
109
+
To fix the issue, use an SNAT pool that contains a single IP address, or force the use of a specific IP address for connections to the Exchange Online Protection PowerShell endpoint.
106
110
107
111
## See also
108
112
109
113
The cmdlets that you use in this topic are Windows PowerShell cmdlets. For more information about these cmdlets, see the following topics.
Copy file name to clipboardExpand all lines: exchange/docs-conceptual/exchange-eop/exchange-online-protection-powershell.md
+9-6Lines changed: 9 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: "Exchange Online Protection PowerShell"
3
3
ms.author: chrisda
4
4
author: chrisda
5
-
manager: serdars
5
+
manager: dansimp
6
6
ms.date: 2/20/2018
7
7
ms.audience: Admin
8
8
ms.topic: article
@@ -14,16 +14,19 @@ description: "Learn about using PowerShell in Exchange Online Protection"
14
14
15
15
# Exchange Online Protection PowerShell
16
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:
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.
18
+
19
+
> [!NOTE]
20
+
> Exchange Online Protection PowerShell is only used in *standalone* EOP organizations (for example, you have a standalone EOP subscription to protect your on-premises email environment). If you have an Office 365 subscription that includes EOP (E3, E5, etc.), you don't use Exchange Online Protection PowerShell; the same features are available in [Exchange Online PowerShell](../exchange-online/exchange-online-powershell.md).
21
+
22
+
The following topics provide information about using Exchange Online Protection PowerShell:
18
23
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).
24
+
- To create a remote PowerShell session to your standalone Exchange Online Protection organization, see [Connect to Exchange Online Protection PowerShell](connect-to-exchange-online-protection-powershell.md).
20
25
21
26
- 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](https://technet.microsoft.com/library/e87e84e1-7be0-44bf-a414-d91d60ed8817.aspx).
22
27
23
28
- The following introductory video shows you how to connect to and use Exchange Online Protection PowerShell.
24
29
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.
30
+
**Note:** This video applies to Exchange Online and standalone EOP organizations. When you connect to your organization, be sure to specify the correct URL (_ConnectionUri_ value). The required URL is different for Exchange Online and standalone EOP organizations.
26
31
27
32
[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)
Copy file name to clipboardExpand all lines: exchange/docs-conceptual/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell.md
+16-11Lines changed: 16 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: "Connect to Exchange Online PowerShell"
3
3
ms.author: chrisda
4
4
author: chrisda
5
-
manager: serdars
5
+
manager: dansimp
6
6
ms.date: 7/10/2017
7
7
ms.audience: Admin
8
8
ms.topic: article
@@ -16,10 +16,11 @@ description: "Learn how to use remote PowerShell to connect to Exchange Online."
16
16
---
17
17
18
18
# Connect to Exchange Online PowerShell
19
+
19
20
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.
20
21
21
22
> [!IMPORTANT]
22
-
> 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). <br/><br/> 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.
23
+
> 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). <br/><br/> If you're a standalone Exchange Online Protection (EOP) customer (for example, you're using EOP to protect your on-premises email environment), use the connection instructions in [Connect to Exchange Online Protection PowerShell](../../exchange-eop/connect-to-exchange-online-protection-powershell.md). If your standalone 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.
23
24
24
25
## What do you need to know before you begin?
25
26
@@ -31,6 +32,8 @@ Exchange Online PowerShell allows you to manage your Exchange Online settings fr
31
32
32
33
- Windows 8.1
33
34
35
+
- Windows Server 2019
36
+
34
37
- Windows Server 2016
35
38
36
39
- Windows Server 2012 or Windows Server 2012 R2
@@ -47,7 +50,7 @@ Exchange Online PowerShell allows you to manage your Exchange Online settings fr
47
50
48
51
To require all PowerShell scripts that you download from the internet are signed by a trusted publisher, run the following command in an elevated Windows PowerShell window (a Windows PowerShell window you open by selecting **Run as administrator**):
49
52
50
-
```
53
+
```PowerShell
51
54
Set-ExecutionPolicy RemoteSigned
52
55
```
53
56
@@ -56,19 +59,19 @@ Exchange Online PowerShell allows you to manage your Exchange Online settings fr
56
59
> [!TIP]
57
60
> 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).
58
61
59
-
## Connect to Exchange Online PowerShell
62
+
## Connect to Exchange Online
60
63
61
64
1. On your local computer, open Windows PowerShell and run the following command.
62
65
63
-
```
66
+
```PowerShell
64
67
$UserCredential = Get-Credential
65
68
```
66
69
67
70
In the **Windows PowerShell Credential Request** dialog box, type your work or school account and password, and then click **OK**.
@@ -86,16 +89,16 @@ Exchange Online PowerShell allows you to manage your Exchange Online settings fr
86
89
87
90
For more information, see [New-PSSessionOption](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-pssessionoption).
88
91
89
-
3. Run the following command.
92
+
3. Run the following command:
90
93
91
-
```
94
+
```PowerShell
92
95
Import-PSSession $Session -DisableNameChecking
93
96
```
94
97
95
98
> [!NOTE]
96
-
> 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.
99
+
> 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.
97
100
98
-
```
101
+
```PowerShell
99
102
Remove-PSSession $Session
100
103
```
101
104
@@ -113,6 +116,8 @@ If you receive errors, check the following requirements:
113
116
114
117
- 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.
115
118
119
+
- If your organization uses federated authentication, and your identity provider (IDP) and/or security token service (STS) isn't publicly available, you can't use a federated account to connect to Exchange Online PowerShell. Instead, create and use a non-federated account in Office 365 to connect to Exchange Online PowerShell.
120
+
116
121
## See also
117
122
118
123
The cmdlets that you use in this topic are Windows PowerShell cmdlets. For more information about these cmdlets, see the following topics.
0 commit comments