# Microsoft O365

## Connection Requirements

{% stepper %}
{% step %}

### Client ID

Client ID (Application ID) of the registered Azure AD application used to access Microsoft O365.
{% endstep %}

{% step %}

### Client Secret

* In the left menu, go to Certificates & Secrets and click New client secret. Provide a description and expiration period, then click Add. Make sure to copy the secret value immediately — you won’t be able to see it again later.
* Next, open API Permissions > Add a permission.
* Select Microsoft Graph, then choose Application permissions.
* Add the permissions your application needs. Commonly used ones include:
  * Users.Read.All – Read all user profiles
  * Directory.Read.All – Read directory data
  * Sites.Read.All – Read SharePoint sites
  * Files.Read.All – Read all files that the app can access
    {% endstep %}

{% step %}

### Tenant ID

Tenant ID (Directory ID) of the Microsoft O365 tenant.
{% endstep %}

{% step %}

### Timeout

Define the maximum duration, in seconds, before the connection is automatically closed if there is no response. This field defaults to 30 seconds. Adjust this value if your network or server configuration requires a longer timeout period.
{% endstep %}

{% step %}

### Fetch Users Licenses

When this option is enabled OctoXLabs will fetch user assigned licenses information.

{% hint style="info" %}
For enabling this option you must have at least the following permission:

* LicenseAssignment.Read.All

Or one of the higher permissions:

* Directory.Read.All
* Directory.ReadWrite.All
* Organization.Read.All
* Organization.ReadWrite.All
  {% endhint %}
  {% endstep %}
  {% endstepper %}

{% hint style="warning" %}
Please perform a connection test to ensure there is a valid connection to the host.\
When the discovery operation is finalized, you will be able to see the details on the Assets page.
{% endhint %}


---

# 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://docs.octoxlabs.com/adapters/adapters/microsoft-o365.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.
