> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jinba.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Users

> Look up Microsoft 365 user profiles and manager relationships via Microsoft Graph

## Overview

Microsoft Users tools let you resolve Microsoft 365 user emails and UPNs to full directory profiles, and look up each user's direct manager, through Microsoft Graph.

## Key Features

* `MICROSOFT_GET_USERS`
  * Resolve a list of email addresses or UPNs to Microsoft 365 user profiles. Returns display name, mail, job title, department, company name, and office location. Unresolved identifiers are returned in `notFound`.
* `MICROSOFT_GET_MANAGER`
  * Look up the direct manager of each input user. Returns a list of `{ user, manager }` pairs where `manager` is `null` if no manager is set. Unresolved identifiers are returned in `notFound`.

## Authentication

These tools require a Microsoft Graph OAuth token with delegated `User.Read.All` permission.

Go to the [Jinba secrets dashboard](https://flow.jinba.io/workspace/secrets) and connect a Microsoft account for User Directory. Use the generated token in the tool config.

> **Tenant admin consent is required.** `User.ReadBasic.All` is NOT sufficient — company name and department are only accessible with `User.Read.All`. The Azure AD app registration must have delegated `User.Read.All` added and admin-consented before these tools work.

### Example: Resolve Users and Look Up Their Managers

```yaml theme={null}
- id: get_users
  name: get_users
  tool: MICROSOFT_GET_USERS
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_USERS.access_token}}"
  input:
    - name: identifiers
      value:
        - "alice@example.com"
        - "bob@example.com"

- id: get_managers
  name: get_managers
  tool: MICROSOFT_GET_MANAGER
  needs: ["get_users"]
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_USERS.access_token}}"
  input:
    - name: identifiers
      value: "{{steps.get_users.result.users[*].userPrincipalName}}"
```

## Input

### `identifiers`

A list of email addresses or User Principal Names (UPNs) to look up. Accepts:

* An array: `["alice@example.com", "bob@example.com"]`
* A comma-separated string: `"alice@example.com, bob@example.com"`
* A JSON array string: `"[\"alice@example.com\", \"bob@example.com\"]"`

## Output

### `MICROSOFT_GET_USERS`

| Field                              | Description                            |
| ---------------------------------- | -------------------------------------- |
| `result.users[].id`                | Azure AD object ID                     |
| `result.users[].displayName`       | Display name                           |
| `result.users[].mail`              | Primary email address                  |
| `result.users[].userPrincipalName` | User Principal Name (UPN)              |
| `result.users[].jobTitle`          | Job title                              |
| `result.users[].department`        | Department                             |
| `result.users[].companyName`       | Company name                           |
| `result.users[].officeLocation`    | Office location                        |
| `result.notFound[]`                | Identifiers that could not be resolved |

### `MICROSOFT_GET_MANAGER`

| Field                       | Description                                                  |
| --------------------------- | ------------------------------------------------------------ |
| `result.managers[].user`    | The input identifier for this entry                          |
| `result.managers[].manager` | Manager's profile (same fields as a user), or `null` if none |
| `result.notFound[]`         | Identifiers that could not be resolved                       |
