Skip to content

Commit 04bbb6e

Browse files
committed
Merge branch 'master' into CAPR-chrisda
2 parents c901d6c + 15ca7da commit 04bbb6e

File tree

1,353 files changed

+18943
-10365
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,353 files changed

+18943
-10365
lines changed

exchange/docs-conceptual/app-only-auth-powershell-v2.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ ms.collection: Strat_EX_Admin
1313
ms.custom:
1414
ms.assetid:
1515
search.appverid: MET150
16-
ROBOTS: NOINDEX, NOFOLLOW
1716
description: "Learn about using the Exchange Online V2 module in scripts and other long-running tasks with modern authentication and app-only authentication."
1817
---
1918

@@ -41,7 +40,7 @@ The following examples show how to use the Exchange Online PowerShell V2 module
4140
```
4241

4342
When you use the _CertificateThumbPrint_ parameter, the certificate needs to be installed on the computer where you are running the command. The certificate should be installed in the user certificate store.
44-
43+
4544
- Connect using a certificate object:
4645

4746
```powershell
@@ -50,11 +49,17 @@ The following examples show how to use the Exchange Online PowerShell V2 module
5049

5150
When you use the _Certificate_ parameter, the certificate does not need to be installed on the computer where you are running the command. This parameter is applicable for scenarios where the certificate object is stored remotely and fetched at runtime during script execution.
5251

52+
> [!TIP]
53+
>
54+
> - In the **Connect-ExchangeOnline** commands, be sure to use an `.onmicrosoft.com` domain in the _Organization_ parameter value. Otherwise, you might encounter cryptic permission issues when you run commands in the app context.
55+
>
56+
> - App-only authentication does not support delegation. Unattended scripting in delegation scenarios is supported with the Secure App Model. For more information, go [here](https://docs.microsoft.com/powershell/partnercenter/multi-factor-auth#exchange).
57+
5358
## How does it work?
5459

5560
The EXO V2 module uses the Active Directory Authentication Library to fetch an app-only token using the application Id, tenant Id (organization), and certificate thumbprint. The application object provisioned inside Azure AD has a Directory Role assigned to it, which is returned in the access token. Exchange Online configures the session RBAC using the directory role information that's available in the token.
5661

57-
## Setup app-only authentication
62+
## Set up app-only authentication
5863

5964
An initial onboarding is required for authentication using application objects. Application and service principal are used interchangeably, but an application is like a class object while a service principal is like an instance of the class. You can learn more about this at [Application and service principal objects in Azure Active Directory](https://docs.microsoft.com/azure/active-directory/develop/app-objects-and-service-principals).
6065

@@ -73,7 +78,7 @@ For a detailed visual flow about creating applications in Azure AD, see <https:/
7378
- Create and configure a self-signed X.509 certificate, which will be used to authenticate your Application against Azure AD, while requesting the app-only access token.
7479

7580
- This is similar to generating a password for user accounts. The certificate can be self-signed as well. See the [Appendix](#step-3-generate-a-self-signed-certificate) section later in this topic for instructions for generating certificates in PowerShell.
76-
81+
7782
> [!NOTE]
7883
> Cryptography: Next Generation (CNG) certificates are not supported for app-only authentication with Exchange. CNG certificates are created by default in modern Windows versions. You must use a certificate from a CSP key provider. The [Appendix](#step-3-generate-a-self-signed-certificate) section covers two supported methods to create a CSP certificate.
7984
@@ -121,25 +126,27 @@ If you encounter problems, check the [required permssions](https://docs.microsof
121126

122127
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).
123128

124-
1. Select **API permissions**.
125-
126-
2. In the **Configured permissions** page that appears, click **Add permission**.
127-
128-
3. In the flyout that appears, select **Exchange**.
129-
130-
![Select Exchange API permssions](media/app-only-auth-exchange-api-perms.png)
131-
132-
4. In the flyout that appears, click **Application permissions**.
129+
1. Select **Manifest** in the left-hand navigation under **Manage**.
133130

134-
5. In the **Select permissions** section that appears on the page, expand **Exchange** and select **Exchange.ManageAsApp**
131+
2. Locate the `requiredResourceAccess` property in the manifest, and add the following inside the square brackets (`[]`):
135132

136-
![Select Exchange.ManageAsApp permssions](media/app-only-auth-exchange-manageasapp.png)
133+
```json
134+
{
135+
"resourceAppId": "00000002-0000-0ff1-ce00-000000000000",
136+
"resourceAccess": [
137+
{
138+
"id": "dc50a0fb-09a3-484d-be87-e023b12c6440",
139+
"type": "Role"
140+
}
141+
]
142+
}
143+
```
137144

138-
When you're finished, click **Add permissions**.
145+
3. Select **Save**.
139146

140-
6. Back on the **Configured permissions** page that appears, click **Grant admin consent for \<tenant name\>**, and select **Yes** in the dialog that appears.
147+
4. Select **API permissions** under **Manage**. Confirm that the **Exchange.ManageAsApp** permission is listed.
141148

142-
7. Close the flyout when you're finished.
149+
5. Select **Grant admin consent for org** and accept the consent dialog.
143150

144151
## Step 3: Generate a self-signed certificate
145152

@@ -149,7 +156,7 @@ Create a self-signed x.509 certificate using one of the following methods:
149156

150157
```powershell
151158
# Create certificate
152-
$mycert = New-SelfSignedCertificate -DnsName "example.com" -CertStoreLocation "cert:\LocalMachine\My" -NotAfter (Get-Date).AddYears(1)
159+
$mycert = New-SelfSignedCertificate -DnsName "example.com" -CertStoreLocation "cert:\LocalMachine\My" -NotAfter (Get-Date).AddYears(1) -KeySpec KeyExchange
153160
154161
# Export certificate to .pfx file
155162
$mycert | Export-PfxCertificate -FilePath mycert.pfx -Password $(ConvertTo-SecureString -String "1234" -Force -AsPlainText)

exchange/docs-conceptual/basic-auth-connect-to-eop-powershell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The following introductory video shows you how to connect to and use Exchange On
6161
**Note**: You must temporarily enable WinRM to run the following commands. You can enable it by running the command: `winrm quickconfig`.
6262

6363
To verify that Basic authentication is enabled for WinRM, run this command **in a Command Prompt** (not in Windows PowerShell):
64-
64+
6565
```dos
6666
winrm get winrm/config/client/auth
6767
```
@@ -124,7 +124,7 @@ If you receive errors, check the following requirements:
124124

125125
- 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.
126126

127-
- To help prevent denial-of-service (DoS) attacks, you're limited to three open remote PowerShell connections to your Exchange Online Protection organization.
127+
- To help prevent denial-of-service (DoS) attacks, you're limited to five open remote PowerShell connections to Exchange Online Protection.
128128

129129
- 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.
130130

exchange/docs-conceptual/basic-auth-connect-to-exo-powershell.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ The following introductory video shows you how to connect to and use Exchange On
6464
**Note**: You must temporarily enable WinRM to run the following commands. You can enable it by running the command: `winrm quickconfig`.
6565

6666
To verify that Basic authentication is enabled for WinRM, run this command **in a Command Prompt** (not in Windows PowerShell):
67-
67+
6868
```dos
6969
winrm get winrm/config/client/auth
7070
```
@@ -134,7 +134,7 @@ If you receive errors, check the following requirements:
134134

135135
- 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.
136136

137-
- To help prevent denial-of-service (DoS) attacks, you're limited to three open remote PowerShell connections to your Exchange Online organization.
137+
- To help prevent denial-of-service (DoS) attacks, you're limited to five open remote PowerShell connections to Exchange Online.
138138

139139
- 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).
140140

exchange/docs-conceptual/basic-auth-connect-to-scc-powershell.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ Security & Compliance Center PowerShell allows you to manage your Security & Com
2323

2424
> [!NOTE]
2525
> The procedures in this topic won't work if:
26-
>
26+
>
2727
> - Your account uses multi-factor authentication (MFA).
28-
>
28+
>
2929
> - Your organization uses federated authentication.
30-
>
30+
>
3131
> - A location condition in an Azure Active Directory conditional access policy restricts your access to trusted IPs.
32-
>
32+
>
3333
> In these scenarios, you need to download and use the Exchange Online PowerShell V2 module (EXO V2 module) to connect to Security & Compliance Center PowerShell. For instructions, see [Connect to Security & Compliance Center PowerShell using the EXO V2 module](connect-to-scc-powershell.md).
34-
>
34+
>
3535
> Some features in the Security & Compliance Center (for example, mailbox archiving) link to existing functionality in Exchange Online. To use PowerShell with these features, you need to connect to Exchange Online PowerShell instead of Security & Compliance Center PowerShell. For instructions, see [Connect to Exchange Online PowerShell](connect-to-exchange-online-powershell.md).
3636
3737
## What do you need to know before you begin?
@@ -133,7 +133,7 @@ If you receive errors, check the following requirements:
133133

134134
- Verify that your account has permission to access the Security & Compliance Center. For details, see [Give users access to the Security & Compliance Center](https://docs.microsoft.com/microsoft-365/security/office-365-security/grant-access-to-the-security-and-compliance-center).
135135

136-
- To help prevent denial-of-service (DoS) attacks, you're limited to three open remote PowerShell connections to the Security & Compliance Center.
136+
- To help prevent denial-of-service (DoS) attacks, you're limited to five open remote PowerShell connections to the Security & Compliance Center.
137137

138138
- 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.
139139

0 commit comments

Comments
 (0)