Microsoft
Overview
The Microsoft Connector provides comprehensive integration with Microsoft 365 services through the Microsoft Graph API. This connector enables organizations to automate user management tasks, including creating and managing user accounts, granting licenses, managing email configurations, and generating temporary passwords. Developed by the Leena AI Integration Team, this connector streamlines Microsoft 365 administrative operations.
API Details
Leena AI integrates with Microsoft 365 via Microsoft Graph API.
Documentation link: https://learn.microsoft.com/en-us/graph/overview
Setup
The Microsoft Connector uses OAuth 2.0 Client Credentials Flow for secure authentication with Microsoft Graph API.
Prerequisites
Before setting up the Microsoft connector, ensure you have:
- Administrator access to your Azure Portal
- Access to Azure Active Directory
- Ability to create app registrations in Azure
- Access to your Leena AI workspace with connector management permissions
Get credentials
Here is how to create an app registration in Azure:
-
Navigate to Azure Portal at https://portal.azure.com/#home
-
Click on New Registration
-
Configure App Registration:
-
Name: Provide the name of the application
-
Copy the Tenant ID and Client ID from the overview page
-
Create Client Secret:
-
Click on 'Certificates and secrets'
-
Click on New Client Secret
-
Select an expiry period (commonly configured as 24 Months)
-
Copy the Secret value immediately (it won't be shown again)
-
-
Configure API Permissions:
-
Go to API Permissions (on the left side tab)
-
Click on Add a permission
-
Select the relevant permissions based on your use case:
-
User.ReadWrite.All
-
UserAuthenticationMethod.ReadWrite.All
-
User-PasswordProfile.ReadWrite.All
-
-
After adding permissions, click on Grant admin permission
-
-
Create App Role:
-
Click on App role, then Create App role
-
Under the pop-up, add the details:
- Name: Name of Application
- Member types: Select Applications
- Value: User.ReadWrite.All, UserAuthenticationMethod.ReadWrite.All, User-PasswordProfile.ReadWrite.All
-
Add connection
Here is how to add a connection on Leena AI:
- Log in to your Leena AI workspace
- Navigate to Settings > Integrations
- Search for "Microsoft" and select it from the list to add its new connector
- Click on Connect and configure the following details:
- Tenant ID: The Azure AD tenant ID (Directory ID) from step 4 of app registration
- Client ID: The Application (client) ID from your Azure AD app registration from step 4
- Client Secret: The client secret value from step 5 of app registration
- Save the connector configuration
Actions
The following actions are supported for the Microsoft connector:
List Users
Retrieves users from Microsoft 365 tenant with optional filtering and pagination. The Agent can leverage the skill (workflow), which has been designed to retrieve a list of users from the Microsoft 365 tenant, once the user raises a query to do so.
Input Parameters
Here are the input parameters required to set up this action:
Optional
| Name | Description |
|---|---|
| Filter | OData filter query to narrow down results (e.g., "startswith(displayName,'John')") |
| Count | Boolean to include count of items in response |
| Select | Comma-separated list of properties to include in results |
| Expand | Comma-separated list of relationships to expand in the response |
| Top | Number of items to return (pagination) |
| OrderBy | Property name and direction for sorting results |
| Search | Search query string for filtering results |
| Skip Token | Token for continuing pagination from a previous request |
Here is a sample JSON input:
{
"Filter": "startswith(displayName,'John')",
"Select": "displayName,userPrincipalName,mail",
"Top": 50,
"OrderBy": "displayName"
}Response
The action returns a list of users, each containing the requested properties such as display name, user principal name, email, and other selected attributes.
Create User
Creates a new user account in Microsoft 365. The Agent can leverage the skill (workflow), which has been designed to create a new user account in Microsoft 365, once the user provides the required details.
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Display Name | The user's full display name |
| User Principal Name | The user's login name ([email protected]) |
| Mail Nickname | The mail alias for the user (username portion of email) |
| Password | Initial password for the user account |
| Account Enabled | Boolean to enable or disable the account upon creation |
Here is a sample JSON input:
{
"Display Name": "John Doe",
"User Principal Name": "[email protected]",
"Mail Nickname": "john.doe",
"Password": "TempPassword123!",
"Account Enabled": true
}Response
Upon successful creation, the action returns the created user details including user ID, display name, user principal name, and account status.
Update User
Modifies an existing user account in Microsoft 365. The Agent can leverage the skill (workflow), which has been designed to update user account details in Microsoft 365, once the user specifies the updates to be made.
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| User ID | The ID of the user to update |
| JSON Body | Update payload in JSON format containing attributes to modify |
Here is a sample JSON input:
{
"User ID": "12345678-1234-1234-1234-123456789012",
"JSON Body": {
"displayName": "John A. Doe",
"jobTitle": "Senior Manager",
"department": "Sales"
}
}Response
Upon successful update, the action returns confirmation of the updated user details.
Delete User
Removes a user account from Microsoft 365. The Agent can leverage the skill (workflow), which has been designed to delete a user account from Microsoft 365, once the user confirms the deletion.
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| User ID | The ID of the user to delete |
Here is a sample JSON input:
{
"User ID": "12345678-1234-1234-1234-123456789012"
}Response
Upon successful deletion, the action returns confirmation of the user account removal.
Assign License
Assigns Microsoft 365 licenses to a user. The Agent can leverage the skill (workflow), which has been designed to assign licenses to users in Microsoft 365, once the user provides the license details.
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| User ID | The ID of the user to assign licenses to |
| License SKU IDs | Array of license SKU IDs to assign |
Optional
| Name | Description |
|---|---|
| Disabled Plans | Optional array of service plans to disable within the licenses |
Here is a sample JSON input:
{
"User ID": "12345678-1234-1234-1234-123456789012",
"License SKU IDs": [
"c42b9cae-ea4f-4ab7-9717-81576235ccac",
"6fd2c87f-b296-42f0-b197-1e91e994b900"
],
"Disabled Plans": []
}Response
Upon successful assignment, the action returns confirmation of the licenses assigned to the user.
Reset Password
Resets a user's password and optionally generates a temporary password. The Agent can leverage the skill (workflow), which has been designed to reset user passwords in Microsoft 365, once the user requests a password reset.
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| User ID | The ID of the user whose password will be reset |
Optional
| Name | Description |
|---|---|
| New Password | The new password to set (leave empty to auto-generate) |
| Force Change Password | Boolean to require password change at next sign-in |
| Generate Temporary Password | Boolean to generate a random temporary password |
Here is a sample JSON input:
{
"User ID": "12345678-1234-1234-1234-123456789012",
"Force Change Password": true,
"Generate Temporary Password": true
}Response
Upon successful reset, the action returns the new password details and confirmation of the password reset.
Get User Details
Retrieves detailed information about a specific user. The Agent can leverage the skill (workflow), which has been designed to fetch user details from Microsoft 365, once the user requests information about a specific user.
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| User ID | The ID of the user to retrieve details for |
Optional
| Name | Description |
|---|---|
| Select | Comma-separated list of properties to include |
| Expand | Comma-separated list of relationships to expand |
Here is a sample JSON input:
{
"User ID": "12345678-1234-1234-1234-123456789012",
"Select": "displayName,mail,jobTitle,department",
"Expand": "manager"
}Response
The action returns detailed user information including the requested properties and expanded relationships.
List Groups
Retrieves groups from Microsoft 365 tenant with optional filtering. The Agent can leverage the skill (workflow), which has been designed to list groups from Microsoft 365, once the user raises a query to do so.
Input Parameters
Here are the input parameters required to set up this action:
Optional
| Name | Description |
|---|---|
| Filter | OData filter query to narrow down results |
| Select | Comma-separated list of properties to include |
| Expand | Comma-separated list of relationships to expand |
| Top | Number of items to return |
Here is a sample JSON input:
{
"Filter": "startswith(displayName,'Sales')",
"Select": "displayName,mail,description",
"Top": 25
}Response
The action returns a list of groups with the requested properties.
Add Group Member
Adds a user to a Microsoft 365 group. The Agent can leverage the skill (workflow), which has been designed to add users to groups in Microsoft 365, once the user provides the group and user details.
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| Group ID | The ID of the group to add the member to |
| User ID | The ID of the user to add as a member |
Here is a sample JSON input:
{
"Group ID": "87654321-4321-4321-4321-210987654321",
"User ID": "12345678-1234-1234-1234-123456789012"
}Response
Upon successful addition, the action returns confirmation that the user has been added to the group.
Send Email
Sends an email message from a user's account or shared mailbox. The Agent can leverage the skill (workflow), which has been designed to send emails through Microsoft 365, once the user provides the email details.
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| User ID | The ID of the user from whose mail-box to send the email |
| To Recipients | Array of email addresses for the To field |
| Subject | Email subject line |
| Body Content | Content of the email body |
| Body Type | Format of the body content (HTML or Text) |
Optional
| Name | Description |
|---|---|
| CC Recipients | Optional array of email addresses for the CC field |
| BCC Recipients | Optional array of email addresses for the BCC field |
| Attachments | Optional array of file attachments |
Here is a sample JSON input:
{
"User ID": "12345678-1234-1234-1234-123456789012",
"To Recipients": [
"[email protected]",
"[email protected]"
],
"Subject": "Welcome to the Team",
"Body Content": "<p>Welcome to our organization! We're excited to have you on board.</p>",
"Body Type": "HTML",
"CC Recipients": [
"[email protected]"
]
}Response
Upon successful sending, the action returns confirmation that the email has been sent.
Updated about 20 hours ago
