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
description: "Learn how to use the authentication cmdlets in Microsoft Graph PowerShell"
4
4
5
5
ms.topic: how-to
6
-
ms.date: 08/02/2022
6
+
ms.date: 07/10/2023
7
7
author: msewaweru
8
8
manager: CelesteDG
9
9
ms.author: eunicewaweru
@@ -39,11 +39,35 @@ There are three ways to allow delegated access using `Connect-MgGraph`:
39
39
Connect-MgGraph -AccessToken $AccessToken
40
40
```
41
41
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:
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).
47
71
48
72
- Using Certificate Thumbprint:
49
73
@@ -230,7 +254,7 @@ User.ReadWrite.All
230
254
231
255
## Using Invoke-MgGraphRequest
232
256
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.
234
258
235
259
To retrieve the details of the signed-in user, run:
0 commit comments