# Microsoft Graph

## <mark style="color:red;">Instalación</mark>

```
Install-Module Microsoft.Graph
```

## <mark style="color:red;">Conexión</mark>

* Autenticación interactiva:

```powershell
Connect-MgGraph -Scopes "User.Read.All"
```

* Con código de dispositivo:

```powershell
Connect-MgGraph -Scopes "User.Read.All" -UseDeviceAuthentication
```

* Token de acceso:

```powershell
Connect-MgGraph -AccessToken $AccessToken
```

* Acceso a una aplicación:
  * Con certificado:

```powershell
Connect-MgGraph -ClientId "<AppID>" -TenantId "<TenantID>" -
CertificateThumbprint "<CERT_THUMBPRINT>"
```

* Con secreto de cliente:

```powershell
Connect-MgGraph -TenantId "<TenantID>" -ClientSecretCredential
$ClientSecretCredential
```

* Usando una identidad administrada:

```powershell
Connect-MgGraph -Identity
```

## <mark style="color:red;">Permisos</mark>

```powershell
Find-MgGraphPermission application
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.xtormin.com/pentesting-en-infraestructuras/cloud/azure/metodologia-de-azure-pentest/reconocimiento-interno/enum-con-herramientas-de-ms/microsoft-graph.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
