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
1. To see your new policy, and to get the policy's **ObjectId**, run the following command:
250
256
251
257
```powershell
252
258
Get-AzureADPolicy -Id $policy.Id
253
259
```
254
260
255
-
2. Update the policy.
261
+
1. Update the policy.
256
262
257
263
You might decide that the first policy you set in this example is not as strict as your service requires. To set your Single-Factor Refresh Token to expire in two days, run the following command:
258
264
@@ -274,21 +280,21 @@ In this example, you create a policy that requires users to authenticate more fr
2. To see your new policy, and to get the policy **ObjectId**, run the following command:
283
+
1. To see your new policy, and to get the policy **ObjectId**, run the following command:
278
284
279
285
```powershell
280
286
Get-AzureADPolicy -Id $policy.Id
281
287
```
282
288
283
-
2. Assign the policy to your service principal. You also need to get the **ObjectId** of your service principal.
289
+
1. Assign the policy to your service principal. You also need to get the **ObjectId** of your service principal.
284
290
285
291
1. Use the [Get-AzureADServicePrincipal](/powershell/module/azuread/get-azureadserviceprincipal) cmdlet to see all your organization's service principals or a single service principal.
286
292
```powershell
287
293
# Get ID of the service principal
288
294
$sp = Get-AzureADServicePrincipal -Filter "DisplayName eq '<service principal display name>'"
289
295
```
290
296
291
-
2. When you have the service principal, run the following command:
297
+
1. When you have the service principal, run the following command:
2. To see your new policy, run the following command:
314
+
1. To see your new policy, run the following command:
309
315
310
316
```powershell
311
317
Get-AzureADPolicy -Id $policy.Id
312
318
```
313
319
314
-
2. Assign the policy to your web API. You also need to get the **ObjectId** of your application. Use the [Get-AzureADApplication](/powershell/module/azuread/get-azureadapplication) cmdlet to find your app's **ObjectId**, or use the [Azure portal](https://portal.azure.com/).
320
+
1. Assign the policy to your web API. You also need to get the **ObjectId** of your application. Use the [Get-AzureADApplication](/powershell/module/azuread/get-azureadapplication) cmdlet to find your app's **ObjectId**, or use the [Azure portal](https://portal.azure.com/).
315
321
316
322
Get the **ObjectId** of your app and assign the policy:
317
323
@@ -334,19 +340,19 @@ In this example, you create a few policies to learn how the priority system work
2. To see your new policy, run the following command:
343
+
1. To see your new policy, run the following command:
338
344
339
345
```powershell
340
346
Get-AzureADPolicy -Id $policy.Id
341
347
```
342
348
343
-
2. Assign the policy to a service principal.
349
+
1. Assign the policy to a service principal.
344
350
345
351
Now, you have a policy that applies to the entire organization. You might want to preserve this 30-day policy for a specific service principal, but change the organization default policy to the upper limit of "until-revoked."
346
352
347
353
1. To see all your organization's service principals, you use the [Get-AzureADServicePrincipal](/powershell/module/azuread/get-azureadserviceprincipal) cmdlet.
348
354
349
-
2. When you have the service principal, run the following command:
355
+
1. When you have the service principal, run the following command:
350
356
351
357
```powershell
352
358
# Get ID of the service principal
@@ -356,13 +362,13 @@ In this example, you create a few policies to learn how the priority system work
0 commit comments