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/app-only-auth-powershell-v2.md
+16-14Lines changed: 16 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -121,25 +121,27 @@ If you encounter problems, check the [required permssions](https://docs.microsof
121
121
122
122
You need to assign the API permission `Exchange.ManageAsApp` so the application can manage Exchange Online. API permissions are required because they have consent flow enabled, which allows auditing (directory roles don't have consent flow).
123
123
124
-
1. Select **API permissions**.
124
+
1. Select **Manifest** in the left-hand navigation under **Manage**.
125
125
126
-
2.In the **Configured permissions** page that appears, click **Add permission**.
126
+
2.Locate the `requiredResourceAccess` property in the manifest, and add the following inside the square brackets (`[]`):
127
127
128
-
3. In the flyout that appears, select **Exchange**.
6. Back on the **Configured permissions** page that appears, click **Grant admin consent for \<tenant name\>**, and select **Yes** in the dialog that appears.
141
-
142
-
7. Close the flyout when you're finished.
144
+
5. Select **Grant admin consent for org** and accept the consent dialog.
Copy file name to clipboardExpand all lines: exchange/docs-conceptual/connect-to-exchange-online-powershell.md
+13-10Lines changed: 13 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -34,9 +34,9 @@ To use the older Exchange Online Remote PowerShell Module to connect to Exchange
34
34
> [!TIP]
35
35
> Having problems? Ask in the [Exchange Online](https://go.microsoft.com/fwlink/p/?linkId=267542) forum.
36
36
37
-
## Connect to Exchange Online PowerShell using MFA
37
+
## Connect to Exchange Online PowerShell using MFA and modern authentication
38
38
39
-
If your account uses multi-factor authentication, use the steps in this section. Otherwise, skip to the [Connect to Exchange Online PowerShell without using MFA](#connect-to-exchange-online-powershell-without-using-mfa) section.
39
+
If your account uses multi-factor authentication, use the steps in this section. Otherwise, skip to the [Connect to Exchange Online PowerShell using modern authentication](#connect-to-exchange-online-powershell-using-modern-authentication) section.
40
40
41
41
1. In a Windows PowerShell window, load the EXO V2 module by running the following command:
42
42
@@ -84,7 +84,7 @@ If your account uses multi-factor authentication, use the steps in this section.
84
84
**This example connects to Exchange Online PowerShell to manage another tenant**:
For detailed syntax and parameter information, see [Connect-ExchangeOnline](https://docs.microsoft.com/powershell/module/exchange/connect-exchangeonline).
@@ -96,7 +96,7 @@ For detailed syntax and parameter information, see [Connect-ExchangeOnline](http
96
96
Disconnect-ExchangeOnline
97
97
```
98
98
99
-
## Connect to Exchange Online PowerShell without using MFA
99
+
## Connect to Exchange Online PowerShell using modern authentication
100
100
101
101
If your account doesn't use multi-factor authentication, use the steps in this section.
102
102
@@ -110,21 +110,24 @@ If your account doesn't use multi-factor authentication, use the steps in this s
110
110
111
111
2. Run the following command:
112
112
113
+
> [!NOTE]
114
+
> You can skip this step and omit the _Credential_ parameter in the next step to be prompted to enter the username and password after you run the **Connect-ExchangeOnline** command. If you omit the _Credential_ parameter and include the _UserPrincipalName_ parameter in the next step, you're only prompted to enter the password after you run the **Connect-ExchangeOnline** command.
115
+
113
116
```powershell
114
117
$UserCredential = Get-Credential
115
118
```
116
119
117
120
In the **Windows PowerShell Credential Request** dialog box that appears, type your work or school account and password, and then click **OK**.
118
121
119
-
3. The command that you need to run uses the following syntax:
122
+
3. The last command that you need to run uses the following syntax:
- When you use the _ExchangeEnvironmentName_ parameter, you don't need use the _ConnectionUri_ or _AzureADAuthorizationEndPointUrl_ parameters. For more information, see the parameter descriptions in [Connect-ExchangeOnline](https://docs.microsoft.com/powershell/module/exchange/connect-exchangeonline).
126
129
- The _DelegatedOrganization_ parameter specifies the customer organization that you want to manage as an authorized Microsoft Partner. For more information, see [Partners](https://docs.microsoft.com/office365/servicedescriptions/office-365-platform-service-description/partners).
127
-
- If you're behind a proxy server, run this command first: `$ProxyOptions = New-PSSessionOption -ProxyAccessType <Value>`, where \<Value\> is `IEConfig`, `WinHttpConfig`, or `AutoDetect`. Then, use the _PSSessionOption_ parameter with the value `$ProxyOptions`. For more information, see [New-PSSessionOption](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-pssessionoption).
130
+
- If you're behind a proxy server, store the output of the [New-PSSessionOption](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-pssessionoption) cmdlet in a variable (for example, `$ProxyOptions = New-PSSessionOption -ProxyAccessType <Value> [-ProxyAuthentication <Value>] [-ProxyCredential <Value>]`). Then, use the variable (`$ProxyOptions`) as the value for the _PSSessionOption_ parameter.
128
131
129
132
**Connect to Exchange Online PowerShell in a Microsoft 365 or Microsoft 365 GCC organization**:
130
133
@@ -159,7 +162,7 @@ If your account doesn't use multi-factor authentication, use the steps in this s
159
162
For detailed syntax and parameter information, see [Connect-ExchangeOnline](https://docs.microsoft.com/powershell/module/exchange/connect-exchangeonline).
160
163
161
164
> [!NOTE]
162
-
> 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.
165
+
> 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:
163
166
164
167
```powershell
165
168
Disconnect-ExchangeOnline
@@ -171,11 +174,11 @@ The Exchange Online cmdlets are imported into your local Windows PowerShell sess
171
174
172
175
If you receive errors, check the following requirements:
173
176
174
-
- 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.
177
+
- A common problem is an incorrect password. Run the three steps again and pay close attention to the username and password that you use.
175
178
176
179
- To help prevent denial-of-service (DoS) attacks, you're limited to five open remote PowerShell connections to Exchange Online.
177
180
178
-
- The account you use to connect to 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).
181
+
- The account that you use to connect to 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).
179
182
180
183
- TCP port 80 traffic needs to be open between your local computer and Microsoft 365. It's probably open, but it's something to consider if your organization has a restrictive internet access policy.
Copy file name to clipboardExpand all lines: exchange/docs-conceptual/connect-to-exchange-online-protection-powershell.md
+12-9Lines changed: 12 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -34,9 +34,9 @@ To use the older, less secure remote PowerShell connection instructions that [wi
34
34
> [!TIP]
35
35
> Having problems? Ask for help in the [Exchange Online Protection](https://go.microsoft.com/fwlink/p/?linkId=285351) forum.
36
36
37
-
## Connect to Exchange Online Protection PowerShell using MFA
37
+
## Connect to Exchange Online Protection PowerShell using MFA and modern authentication
38
38
39
-
If your account uses multi-factor authentication, use the steps in this section. Otherwise, skip to the [Connect to Exchange Online Protection PowerShell without using MFA](#connect-to-exchange-online-protection-powershell-without-using-mfa) section.
39
+
If your account uses multi-factor authentication, use the steps in this section. Otherwise, skip to the [Connect to Exchange Online Protection PowerShell using modern authentication](#connect-to-exchange-online-protection-powershell-using-modern-authentication) section.
40
40
41
41
1. In a Windows PowerShell window, load the EXO V2 module by running the following command:
42
42
@@ -77,7 +77,7 @@ For detailed syntax and parameter information, see [Connect-IPPSSession](https:/
77
77
Disconnect-ExchangeOnline
78
78
```
79
79
80
-
## Connect to Exchange Online Protection PowerShell without using MFA
80
+
## Connect to Exchange Online Protection PowerShell using modern authentication
81
81
82
82
If your account doesn't use multi-factor authentication, use the steps in this section.
83
83
@@ -91,20 +91,23 @@ If your account doesn't use multi-factor authentication, use the steps in this s
91
91
92
92
2. Run the following command:
93
93
94
+
> [!NOTE]
95
+
> You can skip this step and omit the _Credential_ parameter in the next step to be prompted to enter the username and password after you run the **Connect-IPPSSession** command. If you omit the _Credential_ parameter and include the _UserPrincipalName_ parameter in the next step, you're only prompted to enter the password after you run the **Connect-IPPSSession** command.
96
+
94
97
```powershell
95
98
$UserCredential = Get-Credential
96
99
```
97
100
98
101
In the **Windows PowerShell Credential Request** dialog box that appears, type your work or school account and password, and then click **OK**.
99
102
100
-
3. The command that you need to run uses the following syntax:
103
+
3. The last command that you need to run uses the following syntax:
- The required _ConnectionUri_ value depends on the nature of your Microsoft 365 organization. For more information, see the parameter description in [Connect-IPPSSession](https://docs.microsoft.com/powershell/module/exchange/connect-ippssession).
107
-
- If you're behind a proxy server, run this command first: `$ProxyOptions = New-PSSessionOption -ProxyAccessType <Value>`, where \<Value\> is `IEConfig`, `WinHttpConfig`, or `AutoDetect`. Then, use the _PSSessionOption_ parameter with the value `$ProxyOptions`. For more information, see [New-PSSessionOption](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-pssessionoption).
110
+
- If you're behind a proxy server, store the output of the [New-PSSessionOption](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-pssessionoption) cmdlet in a variable (for example, `$ProxyOptions = New-PSSessionOption -ProxyAccessType <Value> [-ProxyAuthentication <Value>] [-ProxyCredential <Value>]`). Then, use the variable (`$ProxyOptions`) as the value for the _PSSessionOption_ parameter.
108
111
109
112
**This example connects to Exchange Online Protection PowerShell in a Microsoft 365 organization**:
110
113
@@ -121,7 +124,7 @@ If your account doesn't use multi-factor authentication, use the steps in this s
121
124
For detailed syntax and parameter information, see [Connect-IPPSSession](https://docs.microsoft.com/powershell/module/exchange/connect-exchangeonline).
122
125
123
126
> [!NOTE]
124
-
> 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.
127
+
> 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:
125
128
126
129
```powershell
127
130
Disconnect-ExchangeOnline
@@ -133,13 +136,13 @@ The Exchange Online Protection Protection cmdlets are imported into your local W
133
136
134
137
If you receive errors, check the following requirements:
135
138
136
-
- 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.
139
+
- A common problem is an incorrect password. Run the three steps again and pay close attention to the username and password that you use.
137
140
138
141
- To help prevent denial-of-service (DoS) attacks, you're limited to five open remote PowerShell connections to Exchange Online Protection.
139
142
140
143
- TCP port 80 traffic needs to be open between your local computer and Microsoft 365. It's probably open, but it's something to consider if your organization has a restrictive Internet access policy.
141
144
142
-
- The account you use to connect to Exchange Online Protection PowerShell must be represented as a [mail user in EOP](https://docs.microsoft.com/microsoft-365/security/office-365-security/manage-mail-users-in-eop) (created manually or by directory synchronization). If the account is not visible in the Exchange admin center (EAC) as a mail user at **Recipients**\>**Contacts**, you'll receive the following error when you try to connect:
145
+
- The account that you use to connect to Exchange Online Protection PowerShell must be represented as a [mail user in EOP](https://docs.microsoft.com/microsoft-365/security/office-365-security/manage-mail-users-in-eop) (created manually or by directory synchronization). If the account is not visible in the Exchange admin center (EAC) as a mail user at **Recipients**\>**Contacts**, you'll receive the following error when you try to connect:
143
146
144
147
> Import-PSSession : Running the Get-Command command in a remote session reported the following error: Processing data for a remote command failed with the following error message: The request for the Windows Remote Shell with ShellId <GUID> 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.
0 commit comments