Skip to content

Commit fc9a540

Browse files
authored
Merge branch 'main' into alexbuckgit/docutune-autopr-20221026-161900-8055208
2 parents c648cc6 + adc655b commit fc9a540

File tree

19 files changed

+457
-501
lines changed

19 files changed

+457
-501
lines changed

articles/active-directory/app-proxy/application-proxy-register-connector-powershell.md

Lines changed: 68 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -75,74 +75,73 @@ There are two methods you can use to register the connector:
7575

7676
class Program
7777
{
78-
#region constants
79-
/// <summary>
80-
/// The AAD authentication endpoint uri
81-
/// </summary>
82-
static readonly string AadAuthenticationEndpoint = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
83-
84-
/// <summary>
85-
/// The application ID of the connector in AAD
86-
/// </summary>
87-
static readonly string ConnectorAppId = "55747057-9b5d-4bd4-b387-abf52a8bd489";
88-
89-
/// <summary>
90-
/// The AppIdUri of the registration service in AAD
91-
/// </summary>
92-
static readonly string RegistrationServiceAppIdUri = "https://proxy.cloudwebappproxy.net/registerapp/user_impersonation";
93-
94-
#endregion
95-
96-
#region private members
97-
private string token;
98-
private string tenantID;
99-
#endregion
100-
101-
public void GetAuthenticationToken()
102-
{
103-
104-
IPublicClientApplication clientApp = PublicClientApplicationBuilder
105-
.Create(ConnectorAppId)
106-
.WithDefaultRedirectUri() // will automatically use the default Uri for native app
107-
.WithAuthority(AadAuthenticationEndpoint)
108-
.Build();
109-
110-
AuthenticationResult authResult = null;
111-
112-
IAccount account = null;
113-
114-
IEnumerable<string> scopes = new string[] { RegistrationServiceAppIdUri };
115-
116-
try
117-
{
118-
authResult = await clientApp.AcquireTokenSilent(scopes, account).ExecuteAsync();
119-
}
120-
catch (MsalUiRequiredException ex)
121-
{
122-
authResult = await clientApp.AcquireTokenInteractive(scopes).ExecuteAsync();
123-
}
124-
125-
126-
if (authResult == null || string.IsNullOrEmpty(authResult.AccessToken) || string.IsNullOrEmpty(authResult.TenantId))
78+
#region constants
79+
/// <summary>
80+
/// The AAD authentication endpoint uri
81+
/// </summary>
82+
static readonly string AadAuthenticationEndpoint = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
83+
84+
/// <summary>
85+
/// The application ID of the connector in AAD
86+
/// </summary>
87+
static readonly string ConnectorAppId = "55747057-9b5d-4bd4-b387-abf52a8bd489";
88+
89+
/// <summary>
90+
/// The AppIdUri of the registration service in AAD
91+
/// </summary>
92+
static readonly string RegistrationServiceAppIdUri = "https://proxy.cloudwebappproxy.net/registerapp/user_impersonation";
93+
94+
#endregion
95+
96+
#region private members
97+
private string token;
98+
private string tenantID;
99+
#endregion
100+
101+
public void GetAuthenticationToken()
127102
{
128-
Trace.TraceError("Authentication result, token or tenant id returned are null");
129-
throw new InvalidOperationException("Authentication result, token or tenant id returned are null");
103+
IPublicClientApplication clientApp = PublicClientApplicationBuilder
104+
.Create(ConnectorAppId)
105+
.WithDefaultRedirectUri() // will automatically use the default Uri for native app
106+
.WithAuthority(AadAuthenticationEndpoint)
107+
.Build();
108+
109+
AuthenticationResult authResult = null;
110+
111+
IAccount account = null;
112+
113+
IEnumerable<string> scopes = new string[] { RegistrationServiceAppIdUri };
114+
115+
try
116+
{
117+
authResult = await clientApp.AcquireTokenSilent(scopes, account).ExecuteAsync();
118+
}
119+
catch (MsalUiRequiredException ex)
120+
{
121+
authResult = await clientApp.AcquireTokenInteractive(scopes).ExecuteAsync();
122+
}
123+
124+
if (authResult == null || string.IsNullOrEmpty(authResult.AccessToken) || string.IsNullOrEmpty(authResult.TenantId))
125+
{
126+
Trace.TraceError("Authentication result, token or tenant id returned are null");
127+
throw new InvalidOperationException("Authentication result, token or tenant id returned are null");
128+
}
129+
130+
token = authResult.AccessToken;
131+
tenantID = authResult.TenantId;
130132
}
131-
132-
token = authResult.AccessToken;
133-
tenantID = authResult.TenantId;
134-
}
135-
```
133+
}
134+
```
136135

137136
**Using PowerShell:**
138137

139138
```powershell
140139
# Load MSAL (Tested with version 4.7.1)
141140
142-
Add-Type -Path "..\MSAL\Microsoft.Identity.Client.dll"
143-
141+
Add-Type -Path "..\MSAL\Microsoft.Identity.Client.dll"
142+
144143
# The AAD authentication endpoint uri
145-
144+
146145
$authority = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize"
147146
148147
#The application ID of the connector in AAD
@@ -152,7 +151,7 @@ There are two methods you can use to register the connector:
152151
#The AppIdUri of the registration service in AAD
153152
$registrationServiceAppIdUri = "https://proxy.cloudwebappproxy.net/registerapp/user_impersonation"
154153
155-
# Define the resources and scopes you want to call
154+
# Define the resources and scopes you want to call
156155
157156
$scopes = New-Object System.Collections.ObjectModel.Collection["string"]
158157
@@ -162,25 +161,24 @@ There are two methods you can use to register the connector:
162161
163162
[Microsoft.Identity.Client.IAccount] $account = $null
164163
165-
# Acquiring the token
164+
# Acquiring the token
166165
167166
$authResult = $null
168167
169168
$authResult = $app.AcquireTokenInteractive($scopes).WithAccount($account).ExecuteAsync().ConfigureAwait($false).GetAwaiter().GetResult()
170169
171170
# Check AuthN result
172171
If (($authResult) -and ($authResult.AccessToken) -and ($authResult.TenantId)) {
173-
174-
$token = $authResult.AccessToken
175-
$tenantId = $authResult.TenantId
176172
177-
Write-Output "Success: Authentication result returned."
178-
173+
$token = $authResult.AccessToken
174+
$tenantId = $authResult.TenantId
175+
176+
Write-Output "Success: Authentication result returned."
179177
}
180178
Else {
181-
182-
Write-Output "Error: Authentication result, token or tenant id returned with null."
183-
179+
180+
Write-Output "Error: Authentication result, token or tenant id returned with null."
181+
184182
}
185183
```
186184

@@ -199,4 +197,4 @@ There are two methods you can use to register the connector:
199197
## Next steps
200198
* [Publish applications using your own domain name](application-proxy-configure-custom-domain.md)
201199
* [Enable single-sign on](application-proxy-configure-single-sign-on-with-kcd.md)
202-
* [Troubleshoot issues you're having with Application Proxy](application-proxy-troubleshoot.md)
200+
* [Troubleshoot issues you're having with Application Proxy](application-proxy-troubleshoot.md)

articles/active-directory/authentication/how-to-certificate-based-authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,7 @@ To enable CBA and configure username bindings using Graph API, complete the foll
318318

319319
#### Request body:
320320

321-
322-
```http
321+
```http
323322
PATCH https: //graph.microsoft.com/v1.0/policies/authenticationMethodsPolicy/authenticationMethodConfigurations/x509Certificate
324323
Content-Type: application/json
325324
@@ -367,6 +366,7 @@ To enable CBA and configure username bindings using Graph API, complete the foll
367366
}
368367
]
369368
}
369+
```
370370
371371
1. You'll get a `204 No content` response code. Re-run the GET request to make sure the policies are updated correctly.
372372
1. Test the configuration by signing in with a certificate that satisfies the policy.

articles/active-directory/governance/identity-governance-automation.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ To generate a self-signed certificate,
5757

5858
```powershell
5959
$cert | ft Thumbprint
60+
```
6061

6162
1. After you have exported the files, you can remove the certificate and key pair from your local user certificate store. In subsequent steps you will remove the `.pfx` and `.crt` files as well, once the certificate and private key have been uploaded to the Azure Automation and Azure AD services.
6263

@@ -110,12 +111,12 @@ Next, you will create an app registration in Azure AD, so that Azure AD will rec
110111

111112
1. Select each of the permissions that your Azure Automation account will require, then select **Add permissions**.
112113

113-
* If your runbook is only performing queries or updates within a single catalog, then you do not need to assign it tenant-wide application permissions; instead you can assign the service principal to the catalog's **Catalog owner** or **Catalog reader** role.
114-
* If your runbook is only performing queries for entitlement management, then it can use the **EntitlementManagement.Read.All** permission.
115-
* If your runbook is making changes to entitlement management, for example to create assignments across multiple catalogs, then use the **EntitlementManagement.ReadWrite.All** permission.
116-
* For other APIs, ensure that the necessary permission is added. For example, for identity protection, the **IdentityRiskyUser.Read.All** permission should be added.
114+
* If your runbook is only performing queries or updates within a single catalog, then you do not need to assign it tenant-wide application permissions; instead you can assign the service principal to the catalog's **Catalog owner** or **Catalog reader** role.
115+
* If your runbook is only performing queries for entitlement management, then it can use the **EntitlementManagement.Read.All** permission.
116+
* If your runbook is making changes to entitlement management, for example to create assignments across multiple catalogs, then use the **EntitlementManagement.ReadWrite.All** permission.
117+
* For other APIs, ensure that the necessary permission is added. For example, for identity protection, the **IdentityRiskyUser.Read.All** permission should be added.
117118

118-
10. Select **Grant admin permissions** to give your app those permissions.
119+
1. Select **Grant admin permissions** to give your app those permissions.
119120

120121
## Create Azure Automation variables
121122

@@ -148,7 +149,7 @@ Import-Module Microsoft.Graph.Authentication
148149
$ClientId = Get-AutomationVariable -Name 'ClientId'
149150
$TenantId = Get-AutomationVariable -Name 'TenantId'
150151
$Thumbprint = Get-AutomationVariable -Name 'Thumbprint'
151-
Connect-MgGraph -clientId $ClientId -tenantid $TenantId -certificatethumbprint $Thumbprint
152+
Connect-MgGraph -clientId $ClientId -tenantId $TenantId -certificatethumbprint $Thumbprint
152153
```
153154

154155
5. Select **Test pane**, and select **Start**. Wait a few seconds for the Azure Automation processing of your runbook script to complete.
@@ -186,7 +187,7 @@ You can also add input parameters to your runbook, by adding a `Param` section a
186187
```powershell
187188
Param
188189
(
189-
 [String]$AccessPackageAssignmentId
190+
[String] $AccessPackageAssignmentId
190191
)
191192
```
192193

@@ -223,4 +224,4 @@ There are two places where you can see the expiration date in the Azure portal.
223224

224225
## Next steps
225226

226-
- [Create an Automation account using the Azure portal](../../automation/quickstarts/create-azure-automation-account-portal.md)
227+
- [Create an Automation account using the Azure portal](../../automation/quickstarts/create-azure-automation-account-portal.md)

articles/active-directory/hybrid/reference-connect-adsync.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,16 @@ The following documentation provides reference information for the ADSync.psm1 P
2424
This cmdlet resets the password for the service account and updates it both in Azure AD and in the sync engine.
2525

2626
### SYNTAX
27+
2728
#### byIdentifier
28-
```powershell
29+
```powershell
2930
Add-ADSyncADDSConnectorAccount [-Identifier] <Guid> [-EACredential <PSCredential>] [<CommonParameters>]
30-
```
31+
```
3132

3233
#### byName
33-
```powershell
34+
```powershell
3435
Add-ADSyncADDSConnectorAccount [-Name] <String> [-EACredential <PSCredential>] [<CommonParameters>]
35-
```
36+
```
3637

3738
### DESCRIPTION
3839
This cmdlet resets the password for the service account and updates it both in Azure AD and in the sync engine.
@@ -115,20 +116,20 @@ The following documentation provides reference information for the ADSync.psm1 P
115116
116117
### SYNTAX
117118
118-
```powershell
119-
Disable-ADSyncExportDeletionThreshold [[-AADCredential] <PSCredential>] [-WhatIf] [-Confirm]
119+
```powershell
120+
Disable-ADSyncExportDeletionThreshold [[-AADCredential] <PSCredential>] [-WhatIf] [-Confirm]
120121
[<CommonParameters>]
121-
```
122+
```
122123

123124
### DESCRIPTION
124125
Disables feature for deletion threshold at Export stage.
125126

126127
### EXAMPLES
127128

128129
#### Example 1
129-
```powershell
130+
```powershell
130131
PS C:\> Disable-ADSyncExportDeletionThreshold -AADCredential $aadCreds
131-
```
132+
```
132133

133134
Uses the provided AAD Credentials to disable the feature for export deletion threshold.
134135

@@ -137,7 +138,7 @@ The following documentation provides reference information for the ADSync.psm1 P
137138
#### -AADCredential
138139
The AAD credential.
139140

140-
```yaml
141+
```yaml
141142
Type: PSCredential
142143
Parameter Sets: (All)
143144
Aliases:

articles/active-directory/manage-apps/assign-user-or-group-access-portal.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ To assign users to an app using PowerShell, you need:
5353
5454
# Assign the user to the app role
5555
New-AzureADUserAppRoleAssignment -ObjectId $user.ObjectId -PrincipalId $user.ObjectId -ResourceId $sp.ObjectId -Id $appRole.Id
56+
```
5657
5758
To assign a group to an enterprise app, you must replace `Get-AzureADUser` with `Get-AzureADGroup` and replace `New-AzureADUserAppRoleAssignment` with `New-AzureADGroupAppRoleAssignment`.
5859
@@ -68,13 +69,15 @@ This example assigns the user Britta Simon to the Microsoft Workplace Analytics
6869
# Assign the values to the variables
6970
$username = "[email protected]"
7071
$app_name = "Workplace Analytics"
72+
```
7173
7274
1. In this example, we don't know what is the exact name of the application role we want to assign to Britta Simon. Run the following commands to get the user ($user) and the service principal ($sp) using the user UPN and the service principal display names.
7375
7476
```powershell
7577
# Get the user to assign, and the service principal for the app to assign to
7678
$user = Get-AzureADUser -ObjectId "$username"
7779
$sp = Get-AzureADServicePrincipal -Filter "displayName eq '$app_name'"
80+
```
7881
7982
1. Run the command `$sp.AppRoles` to display the roles available for the Workplace Analytics application. In this example, we want to assign Britta Simon the Analyst (Limited access) Role.
8083
![Shows the roles available to a user using Workplace Analytics Role](./media/assign-user-or-group-access-portal/workplace-analytics-role.png)
@@ -84,6 +87,7 @@ This example assigns the user Britta Simon to the Microsoft Workplace Analytics
8487
# Assign the values to the variables
8588
$app_role_name = "Analyst (Limited access)"
8689
$appRole = $sp.AppRoles | Where-Object { $_.DisplayName -eq $app_role_name }
90+
```
8791
8892
1. Run the following command to assign the user to the app role:
8993
@@ -114,12 +118,11 @@ This example assigns the user Britta Simon to the Microsoft Workplace Analytics
114118
115119
## Remove all users who are assigned to the application
116120
117-
```powershell
118-
119-
#Retrieve the service principal object ID.
120-
$app_name = "<Your App's display name>"
121-
$sp = Get-AzureADServicePrincipal -Filter "displayName eq '$app_name'"
122-
$sp.ObjectId
121+
```powershell
122+
#Retrieve the service principal object ID.
123+
$app_name = "<Your App's display name>"
124+
$sp = Get-AzureADServicePrincipal -Filter "displayName eq '$app_name'"
125+
$sp.ObjectId
123126
124127
# Get Service Principal using objectId
125128
$sp = Get-AzureADServicePrincipal -ObjectId "<ServicePrincipal objectID>"

articles/active-directory/manage-apps/delete-application-portal.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,19 @@ To delete an enterprise application, you need:
8484
1. Get the list of enterprise applications in your tenant.
8585

8686
```powershell
87-
Get-MgServicePrincipal
87+
Get-MgServicePrincipal
8888
```
89+
8990
1. Record the object ID of the enterprise app you want to delete.
91+
9092
1. Delete the enterprise application.
9193

9294
```powershell
9395
Remove-MgServicePrincipal -ServicePrincipalId 'd4142c52-179b-4d31-b5b9-08940873507b'
96+
```
9497

9598
:::zone-end
9699

97-
98100
:::zone pivot="ms-graph"
99101

100102
Delete an enterprise application using [Graph Explorer](https://developer.microsoft.com/graph/graph-explorer).

0 commit comments

Comments
 (0)