Skip to content

Commit 2a3e56e

Browse files
authored
Merge pull request MicrosoftDocs#317 from msewaweru/authetication-cmdlets-update-freshness
Update delegated access option and freshness pass
2 parents 3367705 + b7065f3 commit 2a3e56e

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

microsoftgraph/docs-conceptual/authentication-commands.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Using Microsoft Graph PowerShell authentication commands"
33
description: "Learn how to use the authentication cmdlets in Microsoft Graph PowerShell"
44

55
ms.topic: how-to
6-
ms.date: 08/02/2022
6+
ms.date: 07/10/2023
77
author: msewaweru
88
manager: CelesteDG
99
ms.author: eunicewaweru
@@ -39,11 +39,35 @@ There are three ways to allow delegated access using `Connect-MgGraph`:
3939
Connect-MgGraph -AccessToken $AccessToken
4040
```
4141
42+
#### Use delegated access with a custom application for Microsoft Graph PowerShell
43+
44+
Follow the steps below to create custom applications that you can use to connect to Microsoft Graph PowerShell. Use this approach if you need to isolate and limit the consent permissions granted for Microsoft Graph PowerShell usage.
45+
46+
1. Go to the <a href="https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade" target="_blank">Azure portal - App registrations</a> > **New Registration**.
47+
1. Enter a **Name** for your application, for example *Microsoft Graph PowerShell - High Privilege admin use only*.
48+
1. For **Supported account types**, select **Accounts in this organization directory**.
49+
1. For **Redirect URI**:
50+
- Select **Public client/native** from the drop down
51+
- **URI value**: *http://localhost*
52+
1. Select **Register**.
53+
1. Go to **Enterprise applications** and select the application you just created.
54+
1. Under **Manage**, select **Properties** and set **Assignment required?** to **Yes**.
55+
1. Select **Save**.
56+
1. Under **Manage**, select **Users and groups**.
57+
1. Select **Add user/group** and add the users and groups permitted to use this application.
58+
1. Once you've added all the users and groups, select **Assign**.
59+
60+
You can now use this app instead of the default one by connecting with:
61+
62+
```powershell
63+
Connect-MgGraph -ClientId <YOUR_NEW_APP_ID> -TenantId <YOUR_TENANT_ID>
64+
```
65+
4266
### App-only access
4367

4468
#### Using client credential with a certificate
4569

46-
To use app-only access, the certificate is loaded from either *Cert:\CurrentUser\My\\* or *Cert:\LocalMachine\My\\* when `-CertificateThumbprint` or `-CertificateName` is specified. Make sure that the certificate you're using is present in either certificate store before calling `Connect-MgGraph`. For more info, see [Use app-only authentication with the Microsoft Graph PowerShell SDK](app-only.md).
70+
To use app-only access, you can load the certificate from either *Cert:\CurrentUser\My\\* or *Cert:\LocalMachine\My\\*, when `-CertificateThumbprint` or `-CertificateName` is specified. Make sure that the certificate you're using is present in either certificate store before calling `Connect-MgGraph`. For more info, see [Use app-only authentication with the Microsoft Graph PowerShell SDK](app-only.md).
4771

4872
- Using Certificate Thumbprint:
4973

@@ -230,7 +254,7 @@ User.ReadWrite.All
230254

231255
## Using Invoke-MgGraphRequest
232256

233-
`Invoke-MgGraphRequest` issues REST API requests to the Graph API. It works for any Graph API if you know the REST URI, method and optional body parameter. This command is especially useful for accessing APIs for which there isn't an equivalent cmdlet yet.
257+
`Invoke-MgGraphRequest` issues REST API requests to the Graph API. It works for any Graph API if you know the REST URI, method, and optional body parameter. This command is especially useful for accessing APIs for which there isn't an equivalent cmdlet yet.
234258

235259
To retrieve the details of the signed-in user, run:
236260

0 commit comments

Comments
 (0)